Skip to content

Commit 7fe079e

Browse files
committed
feat: install codspeed
1 parent bb327a4 commit 7fe079e

3 files changed

Lines changed: 54 additions & 1 deletion

File tree

.github/workflows/codspeed.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CodSpeed Benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
id-token: write
13+
14+
jobs:
15+
benchmarks:
16+
name: Run benchmarks
17+
runs-on: codspeed-macro
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
toolchain: 1.83.0
25+
26+
- name: Cache cargo registry
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.cargo/registry
30+
key: cargo-registry-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }}
31+
restore-keys: |
32+
cargo-registry-${{ runner.arch }}-
33+
34+
- name: Cache target directory
35+
uses: actions/cache@v4
36+
with:
37+
path: target
38+
key: cargo-target-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }}
39+
restore-keys: |
40+
cargo-target-${{ runner.arch }}-
41+
42+
- name: Install cargo-codspeed
43+
run: cargo install cargo-codspeed --locked
44+
45+
- name: Build benchmarks
46+
run: cargo codspeed build
47+
48+
- name: Run benchmarks
49+
uses: CodSpeedHQ/action@v4
50+
with:
51+
mode: walltime
52+
run: cargo codspeed run

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Cargo.lock
1212
# OS files
1313
.DS_Store
1414
Thumbs.db
15+
target

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77

88
[dev-dependencies]
9-
divan = "0.1"
9+
divan = { package = "codspeed-divan-compat", version = "4.2.1" }
1010

1111
[[bench]]
1212
name = "particle_simulation"

0 commit comments

Comments
 (0)