test: Add benchmark GH action #2
Workflow file for this run
This file contains 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: Benchmarks | |
on: | |
push: | |
branches: | |
- bgins/feat-add-matching-sorts | |
jobs: | |
run-solver-benchmarks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
# Run benchmark with `go test -bench` and stores the output to a file | |
- name: Run benchmarks | |
run: ./stack benchmarks-solver | tee assets/benchmark-output.txt | |
- name: Download previous benchmark data | |
uses: actions/cache@v4 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
tool: 'go' | |
output-file-path: assets/benchmark-output.txt | |
external-data-json-path: ./cache/benchmark-data.json | |
comment-on-alert: true |