forked from rolldown/rolldown
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 2.1 KB
/
Copy pathbenchmark-rust.yml
File metadata and controls
68 lines (59 loc) · 2.1 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
name: Benchmarks Rust
permissions: {}
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- '**/*.rs'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- 'scripts/misc/setup-benchmark-input/**'
- '.github/workflows/benchmark-rust.yml'
pull_request:
types: [opened, synchronize, ready_for_review]
paths:
- '**/*.rs'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- 'scripts/misc/setup-benchmark-input/**'
- '.github/workflows/benchmark-rust.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
codspeed-benchmark:
name: Codspeed Benchmark
if: >
github.event_name != 'pull_request' ||
(github.event.pull_request.draft != true &&
!contains(github.event.pull_request.labels.*.name, 'graphite: merge-when-ready'))
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
with:
cache: true
- name: Setup Rust
uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
with:
tools: just, cargo-codspeed
cache-key: codspeed
save-cache: ${{ github.ref_name == 'main' }}
- name: Setup Benchmark Input
run: just setup-bench
- name: Build benchmark
env:
RUSTFLAGS: '-C debuginfo=1 -C strip=none -g -C lto=false -C codegen-units=16 --cfg codspeed'
run: |
cargo build --release -p bench --bench bench --features codspeed
mkdir -p target/codspeed/analysis/bench
mv target/release/deps/bench-* target/codspeed/analysis/bench
rm target/codspeed/analysis/bench/*.d
- name: Run the benchmarks
uses: CodSpeedHQ/action@d872884a306dd4853acf0f584f4b706cf0cc72a2 # v4.13.0
with:
run: cargo codspeed run -p bench
token: ${{ secrets.CODSPEED_TOKEN }}
mode: simulation