Add GitHub workflow benchmark. #6
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: Monitor benchmarks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
deployments: write | |
jobs: | |
benchmark: | |
name: Run report bench | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update | |
- name: Run benchmark | |
run: cargo bench --bench decimal_bench --bench report_bench -- --output-format bencher | tee output.txt | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Criterion.rs Benchmark | |
tool: 'cargo' | |
output-file-path: output.txt | |
auto-push: false | |
alert-threshold: '200%' | |
comment-on-alert: true | |
fail-on-alert: true | |
alert-comment-cc-users: '@xkikeg' | |
summary-always: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push benchmark result | |
run: git push 'https://you:${{ secrets.GITHUB_TOKEN }}@github.com/you/repo-name.git' gh-pages:gh-pages | |
if: github.event_name != 'pull_request' |