name: Run benchmarks on: pull_request: branches: [master] permissions: contents: read jobs: benchmark: runs-on: ubuntu-latest steps: # Base for comparison is master branch. - name: Checkout code uses: actions/checkout@v6.0.2 with: ref: master - name: Install Go uses: actions/setup-go@v6.2.0 with: go-version: 'stable' - run: go install golang.org/x/perf/cmd/benchstat@latest - run: go test -run=none -bench=. -count=7 -benchtime=200ms -timeout=1h ./... > /tmp/prev - name: Checkout code uses: actions/checkout@v6.0.2 # Second run of benchmarks - run: go test -run=none -bench=. -count=7 -benchtime=200ms -timeout=1h ./... > /tmp/curr - run: benchstat /tmp/prev /tmp/curr