chore(deps): bump the github-actions group across 1 directory with 7 updates #47
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 | |
| on: | |
| pull_request: | |
| branches: [master] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| # Cancel a previous in-flight benchmark run when the PR gets a new push. | |
| concurrency: | |
| group: benchmark-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| benchmark: | |
| name: Benchmark Comparison | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version: stable | |
| # -run='^$' matches no tests, so this runs ONLY benchmarks. Without it, | |
| # `go test -bench` also runs the full unit-test suite (in both checkouts), | |
| # which is what made this job time out at 10m. -benchtime/-count are kept | |
| # modest to keep the PR signal fast; benchstat still flags real regressions. | |
| # | |
| # Results are written to $RUNNER_TEMP, not the workspace: the "Checkout base" | |
| # step below runs actions/checkout again, which cleans the working tree | |
| # (git clean -ffdx) and would otherwise delete pr.bench before benchstat runs. | |
| - name: Run benchmarks on PR | |
| run: go test -bench=. -benchmem -run='^$' -benchtime=100ms -count=6 -timeout=15m ./... | tee "$RUNNER_TEMP/pr.bench" | |
| - name: Checkout base | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| with: | |
| ref: ${{ github.event.pull_request.base.sha }} | |
| - name: Run benchmarks on base | |
| run: go test -bench=. -benchmem -run='^$' -benchtime=100ms -count=6 -timeout=15m ./... | tee "$RUNNER_TEMP/base.bench" | |
| - name: Install benchstat | |
| run: go install golang.org/x/perf/cmd/benchstat@latest | |
| - name: Compare benchmarks | |
| run: | | |
| echo '## Benchmark Comparison' > bench-report.md | |
| echo '' >> bench-report.md | |
| echo '```' >> bench-report.md | |
| benchstat "$RUNNER_TEMP/base.bench" "$RUNNER_TEMP/pr.bench" >> bench-report.md 2>&1 || true | |
| echo '```' >> bench-report.md | |
| - name: Post benchmark results | |
| uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5 | |
| with: | |
| header: benchmark | |
| path: bench-report.md |