-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (43 loc) · 1.6 KB
/
benchmarks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Continuous Benchmarks with Bencher
on:
push:
branches:
- main
pull_request:
jobs:
benchmark_with_bencher:
name: Benchmark with Bencher
permissions:
pull-requests: write
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: core-crypto-mmbtki3h
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCH_PARAMS: "--bench commit --bench encryption --bench key_package --bench create_group --bench mls_proteus -- --quick"
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 # this implicitly caches Rust tools and build artifacts
- name: Install bencher
uses: bencherdev/bencher@main
- name: Run benchmarks on PR
if: github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request'
run: |
bencher run \
--branch '${{ github.head_ref }}' \
--branch-start-point '${{ github.base_ref }}' \
--branch-start-point-hash '${{ github.event.pull_request.base.sha }}' \
--start-point-clone-thresholds \
--testbed ubuntu-latest \
--err \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
--adapter rust_criterion \
"cargo bench ${{ env.BENCH_PARAMS }}"
- name: Run benchmarks on base branch
if: github.event_name == 'push' && github.ref_name == 'main'
run: |
bencher run \
--branch main \
--testbed ubuntu-latest \
--err \
--adapter rust_criterion \
"cargo bench ${{ env.BENCH_PARAMS }}"