-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.93 KB
/
Copy pathbench.yml
File metadata and controls
57 lines (53 loc) · 1.93 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
52
53
54
55
56
57
name: Benchmarks
on:
push:
branches: [master, main]
pull_request:
paths:
- 'crates/**'
- 'Cargo.toml'
- '.github/workflows/bench.yml'
permissions:
contents: write
pull-requests: write
concurrency:
# Serialize per ref so concurrent runs never race on the gh-pages auto-push.
group: bench-${{ github.ref }}
cancel-in-progress: false
jobs:
bench:
name: Run + track criterion benches
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable Rust toolchain
uses: dtolnay/rust-toolchain@1.95.0
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: bench-run
- name: Run criterion benches (machine-readable)
run: |
set -o pipefail
# Only the criterion benches accept `--output-format bencher`; the
# per-crate libtest harness bench targets reject it ("Unrecognized
# option: 'output-format'") and abort `--workspace`, leaving an empty
# file. Select the criterion benches explicitly so the run emits
# bencher-format output for github-action-benchmark to parse.
cargo bench -p coregraph-extractor --bench build_graph \
-p coregraph-query --bench impact \
-- --output-format bencher | tee bench-output.txt
- name: Compare against main + alert on regression
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'cargo'
output-file-path: bench-output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-threshold: '120%'
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: ''
auto-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: bench