Refactoring Simulation concept #95
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: | |
paths: | |
- crates/** | |
- Cargo.toml | |
- Cargo.lock | |
- .github/workflows/bench.yml | |
- pixi.lock | |
permissions: | |
contents: write | |
deployments: write | |
jobs: | |
benchmark: | |
name: Run Rust benchmark with criterion | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: v0.50.2 | |
cache: true | |
frozen: true | |
cache-write: ${{ github.ref == 'refs/heads/main' }} | |
environments: dev | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "gha" | |
save-if: false | |
- name: Run benchmark | |
run: | | |
pixi r -e dev cargo --locked install cargo-criterion | |
pixi r -e dev cargo --locked criterion --output-format bencher --benches 2>&1 | tee output.txt | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
with: | |
name: Rust Benchmark | |
tool: 'cargo' | |
output-file-path: output.txt | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
auto-push: true | |
# Show alert with commit comment on detecting possible performance | |
# regression | |
# Benchmarking with GA is noisy, so only alert significant | |
# regressions. | |
# TODO: This elevated threshold is temporary (see PR for details). | |
# Lower this value once the cache refactor restores performance. | |
alert-threshold: '250%' | |
comment-on-alert: true | |
fail-on-alert: true | |
alert-comment-cc-users: '@castelao @ppinchuk' |