-
Notifications
You must be signed in to change notification settings - Fork 156
80 lines (70 loc) · 2.33 KB
/
codspeed.yml
File metadata and controls
80 lines (70 loc) · 2.33 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CodSpeed
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTUP_TOOLCHAIN: stable
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
bench-matrix:
name: Determine bench matrix
runs-on: ubuntu-24.04
outputs:
benches: ${{ steps.matrix.outputs.benches }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: matrix
uses: ./.github/actions/bench-matrix
benchmarks:
name: Run ${{ matrix.bench.bench }} (${{ matrix.bench.mode }})
runs-on: ${{ matrix.bench.runner }}
# TODO: Restore `environment: codspeed` once GitHub supports filtering deployment messages.
# environment: codspeed
needs: bench-matrix
if: ${{ needs.bench-matrix.outputs.benches != '[]' }}
strategy:
fail-fast: false
matrix:
bench: ${{ fromJson(needs.bench-matrix.outputs.benches) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: mozilla/actions/rust@27cbe8fb5d338c2861b787e5de10410559065db1 # v1.1.3
with:
version: stable
tools: cargo-codspeed
token: ${{ secrets.GITHUB_TOKEN }}
- id: nss-version
uses: ./.github/actions/minimum-version
with:
directory: .
- uses: mozilla/actions/nss@27cbe8fb5d338c2861b787e5de10410559065db1 # v1.1.3
with:
minimum-version: ${{ steps.nss-version.outputs.minimum }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build bench
env:
BENCH: ${{ matrix.bench.bench }}
CRATE: ${{ matrix.bench.crate }}
MODE: ${{ matrix.bench.mode }}
run: cargo codspeed build --package "$CRATE" --locked --features bench --bench "$BENCH" --measurement-mode "$MODE"
- name: Run bench & upload results
uses: CodSpeedHQ/action@c381be0bfd20e844fb45594f6aa182ffcd94545c # v4.15.0
with:
mode: ${{ matrix.bench.mode }}
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }} # zizmor: ignore[secrets-outside-env]