🌱 add benchmark pipeline #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark Test | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Run benchmark | |
working-directory: test/e2e | |
run: | | |
go test -run=^$ -bench=. -benchmem -count=10 > ../../new.txt | |
- name: Compare with baseline | |
run: | | |
go install golang.org/x/perf/cmd/benchstat@latest | |
benchstat benchmarks/baseline.txt new.txt | |