Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Benchmark

on:
push:
branches:
- main
pull_request:

permissions:
contents: write
deployments: write

jobs:
benchmark:
name: Run Criterion Benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Run benchmark
# We use --output-format bencher to make the output compatible with the
# github-action-benchmark action's 'cargo' tool parser.
run: cargo bench --bench bench_main --all-features -- --output-format bencher | tee output.txt

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: RulesXP Benchmark
tool: 'cargo'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: ${{ github.ref == 'refs/heads/main' }}
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '125%'
comment-on-alert: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
fail-on-alert: true
alert-comment-cc-users: '@${{ github.actor }}'
Loading