refactor(bench): simplify metrics and improve time formatting #6
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: Continuous Benchmarking | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| deployments: write | |
| jobs: | |
| benchmark: | |
| name: Performance Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| - name: Run benchmarks | |
| run: | | |
| go test -bench=. -benchmem -run=^$ ./... | tee bench_output.txt | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: Go Benchmarks | |
| tool: 'go' | |
| output-file-path: bench_output.txt | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: true | |
| # Show alert with commit comment on detecting possible performance regression | |
| alert-threshold: '120%' | |
| comment-on-alert: true | |
| fail-on-alert: false | |
| # Enable Job Summary | |
| summary-always: true |