-
-
Notifications
You must be signed in to change notification settings - Fork 56
63 lines (60 loc) · 1.85 KB
/
bencher.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Bencher
on:
push:
branches: main
workflow_dispatch:
jobs:
benchmark_base:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bencherdev/bencher@main
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Base branch benchmarks
run: |
bencher run \
--branch main \
--testbed ubuntu-latest \
--err
env:
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_CMD: cargo bench --all-features
BENCHER_PROJECT: socketioxide
benchmark_pr:
if: github.event_name == 'workflow_dispatch' && github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: bencherdev/bencher@main
- name: PR benchmarks
run: |
bencher run \
--branch '${{ github.head_ref }}' \
--branch-start-point '${{ github.base_ref }}' \
--testbed ubuntu-latest \
--err \
--github-actions '${{ secrets.GITHUB_TOKEN }}'
env:
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_CMD: cargo bench --all-features
BENCHER_PROJECT: socketioxide