-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (47 loc) · 1.43 KB
/
benchmark.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
name: Ahnlich Test PRs for Performance Regression
on:
pull_request:
branches: ["main"]
paths:
- ahnlich/**
env:
CARGO_TERM_COLOR: always
jobs:
run-benchmark-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: ahnlich
- name: Install Cargo benchcmp
working-directory: ./ahnlich
run: cargo install critcmp
- name: Run benchmarks on main branch
working-directory: ./ahnlich
run: cargo bench --bench database -- --save-baseline main
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
clean: false
- name: Run benchmarks on PR branch
working-directory: ./ahnlich
run: cargo bench --bench database -- --save-baseline pr
- name: Compare benchmarks
working-directory: ./ahnlich
run: |
benchmark_output=$(critcmp main pr)
echo $benchmark_output
echo "## Benchmark Results" >> bench_results.md
echo "\`\`\`" >> bench_results.md
echo "$benchmark_output" >> bench_results.md
echo "\`\`\`" >> bench_results.md
- name: Comment PR with execution number
uses: thollander/actions-comment-pull-request@v2
with:
filePath: ahnlich/bench_results.md
comment_tag: benchmark