Skip to content

Merge pull request #33 from eth-hca/test/new-fuzz-targets #90

Merge pull request #33 from eth-hca/test/new-fuzz-targets

Merge pull request #33 from eth-hca/test/new-fuzz-targets #90

Workflow file for this run

name: Benchmarks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
deployments: write
jobs:
benchmark:
name: Run Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Run benchmarks
run: cargo bench --no-fail-fast 2>&1 | tee target/criterion/output.txt
- name: Collect benchmark results
if: github.ref == 'refs/heads/main'
run: |
# Find the first estimates.json produced by criterion and copy it to a fixed path
find target/criterion -name estimates.json | head -1 | xargs -I{} cp {} target/criterion/latest_estimates.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
if: github.ref == 'refs/heads/main'
with:
tool: 'cargo'
output-file-path: target/criterion/latest_estimates.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: '150%'
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: '@eth-hca/maintainers'
- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: always()
with:
name: criterion-results
path: target/criterion/
retention-days: 30