Skip to content

Commit 77f16f1

Browse files
authored
Merge pull request #8 from talagrand/benches
Add perf benches; flatten project structure
2 parents 966af0e + 05b5c68 commit 77f16f1

12 files changed

Lines changed: 630 additions & 62 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Benchmark
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: write
11+
deployments: write
12+
13+
jobs:
14+
benchmark:
15+
name: Run Criterion Benchmarks
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Install Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
24+
- name: Cache dependencies
25+
uses: Swatinem/rust-cache@v2
26+
27+
- name: Run benchmark
28+
# We use --output-format bencher to make the output compatible with the
29+
# github-action-benchmark action's 'cargo' tool parser.
30+
run: cargo bench --bench bench_main --all-features -- --output-format bencher | tee output.txt
31+
32+
- name: Store benchmark result
33+
uses: benchmark-action/github-action-benchmark@v1
34+
with:
35+
name: RulesXP Benchmark
36+
tool: 'cargo'
37+
output-file-path: output.txt
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
# Push and deploy GitHub pages branch automatically
40+
auto-push: ${{ github.ref == 'refs/heads/main' }}
41+
# Show alert with commit comment on detecting possible performance regression
42+
alert-threshold: '125%'
43+
comment-on-alert: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
44+
fail-on-alert: true
45+
alert-comment-cc-users: '@${{ github.actor }}'

0 commit comments

Comments
 (0)