-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (35 loc) · 1.09 KB
/
codspeed.yml
File metadata and controls
40 lines (35 loc) · 1.09 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
name: CodSpeed
on:
push:
branches:
- "main"
pull_request: # run on PRs
branches:
- "main"
workflow_dispatch: # manual trigger
jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
# ✅ Run if:
# - workflow_dispatch
# - PR has 'benchmarks' label
# - push to main (merge)
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmarks')) || github.event_name == 'push' }}
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
with:
channel: stable
cache-target: release
bins: cargo-codspeed
- name: Build the benchmark target(s)
run: cargo codspeed build
- name: Run the benchmarks
uses: CodSpeedHQ/action@v3
env:
HANNOY_READER_PREFETCH_MEMORY: 1048576 # 1MiB
with:
run: cargo codspeed run --bench benchmark
token: ${{ secrets.CODSPEED_TOKEN }}