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
name: Benchmark
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
bench:
name: benches compile and run once
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# `armature-testkit` is `publish = false`, so this crate's dev-dependency on
# it cannot come from the registry. It is the one sibling that still has to
# be present on disk; everything else resolves from crates.io.
- uses: actions/checkout@v5
with:
repository: quinnjr/armature-testkit
# Pinned: without a ref this takes whatever the default branch holds
# at the moment the job starts, which made four repos fail when their
# workflows ran before testkit's own push had landed.
ref: develop
path: armature-testkit
- name: Move the checkout beside this crate
run: |
mkdir -p ../armature-testkit
cp -r armature-testkit/. ../armature-testkit/
rm -rf armature-testkit
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: bench
# `-- --test` runs each benchmark once instead of timing it. A shared CI
# runner cannot produce a number worth comparing, so this guards against
# the thing that actually rots: a benchmark that stops compiling or starts
# panicking because the API moved under it.
- run: cargo bench --all-features -- --test