| 1 |
name: Run benchmarks |
| 2 |
on: |
| 3 |
pull_request: |
| 4 |
branches: [master] |
| 5 |
|
| 6 |
permissions: |
| 7 |
contents: read |
| 8 |
|
| 9 |
jobs: |
| 10 |
benchmark: |
| 11 |
runs-on: ubuntu-latest |
| 12 |
steps: |
| 13 |
|
| 14 |
- name: Checkout code |
| 15 |
uses: actions/[email protected] |
| 16 |
with: |
| 17 |
ref: master |
| 18 |
- name: Install Go |
| 19 |
uses: actions/[email protected] |
| 20 |
with: |
| 21 |
go-version: 'stable' |
| 22 |
- run: go install golang.org/x/perf/cmd/benchstat@latest |
| 23 |
- run: go test -run=none -bench=. -count=7 -benchtime=200ms -timeout=1h ./... > /tmp/prev |
| 24 |
- name: Checkout code |
| 25 |
uses: actions/[email protected] |
| 26 |
|
| 27 |
- run: go test -run=none -bench=. -count=7 -benchtime=200ms -timeout=1h ./... > /tmp/curr |
| 28 |
|
| 29 |
- run: benchstat /tmp/prev /tmp/curr |