-
Notifications
You must be signed in to change notification settings - Fork 18
39 lines (36 loc) · 1.23 KB
/
bench_run.yaml
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
name: MicroBenchmarks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:
# Cancel already running jobs
concurrency:
group: benchmark_run_${{ github.head_ref }}
cancel-in-progress: true
jobs:
benchmarks:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed
- name: Build the benchmark target(s)
run: cargo codspeed build --features alpha-transforms
- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run