-
Notifications
You must be signed in to change notification settings - Fork 90
51 lines (51 loc) · 1.54 KB
/
pull_request.yml
File metadata and controls
51 lines (51 loc) · 1.54 KB
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
on:
pull_request:
branches: [ master ]
name: Benchmarks
jobs:
runBenchmark:
name: run benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo
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') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install critcmp
run: cargo install critcmp --force
- name: Run benchmarks on master
run: |
git checkout origin/master
cd benches && cargo bench -- --save-baseline master
- name: Run benchmarks on PR
run: |
git checkout ${{ github.sha }}
cd benches && cargo bench -- --save-baseline changes
- name: Generate benchmark comparison
run: |
cd benches && critcmp master changes > $GITHUB_WORKSPACE/benchmark_result.txt 2>&1 || true
- name: Save PR number
run: echo "${{ github.event.pull_request.number }}" > pr_number.txt
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: |
benchmark_result.txt
pr_number.txt