feat: implement graph visualization and enhance project structure #19
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: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| benchmark: | |
| name: Run 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.21' | |
| cache: true | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| go mod verify | |
| - name: Run benchmark | |
| run: | | |
| go test -bench=. -benchmem ./... > bench.out | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: Go Benchmark | |
| tool: 'go' | |
| output-file-path: bench.out | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: true | |
| # Show alert with commit comment on detecting possible performance regression | |
| alert-threshold: '200%' | |
| comment-on-alert: true | |
| fail-on-alert: true | |
| # Enable Job Summary for easy viewing of results | |
| summary-always: true | |
| - name: Update README | |
| run: | | |
| ./benchzribe run | |
| - name: Generate graph | |
| run: | | |
| ./benchzribe graph | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results | |
| path: | | |
| bench.out | |
| benchmark-graph.html | |
| retention-days: 90 | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "chore: update benchmark results [skip ci]" | |
| file_pattern: "README.md benchmark-graph.html" | |
| commit_user_name: "github-actions[bot]" | |
| commit_user_email: "github-actions[bot]@users.noreply.github.com" | |
| commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |