File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments