okay maybe not too much worse.. #54
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: Main | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| # contents permission to update benchmark contents in gh-pages branch | |
| contents: write | |
| jobs: | |
| go-bench: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 | |
| with: | |
| go-version-file: './go.mod' | |
| cache-dependency-path: './go.sum' | |
| check-latest: true | |
| - name: Run benchmark | |
| run: | | |
| set -o pipefail | |
| make bench | tee bench_output.txt | |
| - name: Get JSON for benchmark | |
| uses: benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7 | |
| with: | |
| # What benchmark tool the output.txt came from | |
| tool: 'go' | |
| # Where the output from the benchmark tool is stored | |
| output-file-path: bench_output.txt | |
| # Updates the file content instead of generating a Git commit in GitHub Pages branch | |
| external-data-json-path: ./cache/benchmark-data.json | |
| # Workflow will fail when an alert happens | |
| fail-on-alert: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| comment-on-alert: true | |
| - name: Update GH pages with benchmark | |
| uses: benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7 | |
| with: | |
| # What benchmark tool the output.txt came from | |
| tool: 'go' | |
| # Where the output from the benchmark tool is stored | |
| output-file-path: bench_output.txt | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: 'true' | |
| - name: Get CPU information | |
| uses: kenchan0130/actions-system-info@master | |
| id: system-info | |
| - name: Save benchmark JSON | |
| uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| path: ./cache/benchmark-data.json | |
| # Save with commit hash to avoid "cache already exists" | |
| # Save with OS & CPU info to prevent comparing against results from different CPUs | |
| key: ${{ github.sha }}-${{ runner.os }}-${{ steps.system-info.outputs.cpu-model }}-go-benchmark |