name: Benchmarks
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * 0'
jobs:
bench:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Run benchmarks
run: cargo bench --no-run
- name: Run benchmarks with report
run: |
cargo bench --bench auth --bench benchmarks --bench perf -- --noplot 2>&1 | tee benchmark.log
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'cargo'
output-file-path: benchmark.log
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/main' }}
alert-threshold: '150%'
comment-on-alert: true
fail-on-alert: true