Skip to content

Commit 4f146c6

Browse files
committed
ops(benchmarks): add bencher regression tracking
chore(deps.ops): fix bench.yml chore(deps.ops): fix bench.yml tmp
1 parent fac5117 commit 4f146c6

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/bench.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["*"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
bench:
14+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.BENCHER_PROJECT != '' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
20+
- uses: dtolnay/rust-toolchain@stable
21+
- uses: Swatinem/rust-cache@v2
22+
with:
23+
save-if: ${{ github.ref == 'refs/heads/main' }}
24+
- uses: bencherdev/bencher@v0
25+
- run: |
26+
bencher run \
27+
--project ${{ vars.BENCHER_PROJECT }} \
28+
--token ${{ secrets.BENCHER_API_TOKEN }} \
29+
--branch main \
30+
--adapter rust_criterion \
31+
"cargo bench --all-features"
32+
33+
bench-pr:
34+
if: ${{ github.event_name == 'pull_request' && vars.BENCHER_PROJECT != '' }}
35+
runs-on: ubuntu-latest
36+
permissions:
37+
pull-requests: write
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
persist-credentials: false
42+
- uses: dtolnay/rust-toolchain@stable
43+
- uses: Swatinem/rust-cache@v2
44+
with:
45+
save-if: ${{ github.ref == 'refs/heads/main' }}
46+
- uses: bencherdev/bencher@v0
47+
- run: |
48+
bencher run \
49+
--project ${{ vars.BENCHER_PROJECT }} \
50+
--token ${{ secrets.BENCHER_API_TOKEN }} \
51+
--branch ${{ github.head_ref }} \
52+
--start-point main \
53+
--start-point-reset \
54+
--adapter rust_criterion \
55+
--error-on-alert \
56+
--github-actions ${{ secrets.GITHUB_TOKEN }} \
57+
"cargo bench --all-features"

0 commit comments

Comments
 (0)