Skip to content

Commit 82bfa28

Browse files
not-matthiassylvestre
authored andcommitted
refactor: use matrix to reduce deduplication
1 parent 7835dad commit 82bfa28

File tree

1 file changed

+8
-32
lines changed

1 file changed

+8
-32
lines changed

.github/workflows/benchmarks.yml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ concurrency:
1818

1919
jobs:
2020
benchmarks:
21-
name: Run performance benchmarks (CodSpeed)
21+
name: Run ${{ matrix.mode }} benchmarks (CodSpeed)
2222
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
mode:
26+
- simulation
27+
- memory
2328
steps:
2429
- uses: actions/checkout@v6
2530
with:
@@ -37,40 +42,11 @@ jobs:
3742
shell: bash
3843
run: cargo codspeed build
3944

40-
- name: Run performance benchmarks
45+
- name: Run benchmarks
4146
uses: CodSpeedHQ/action@v4
4247
env:
4348
CODSPEED_LOG: debug
4449
with:
45-
mode: simulation
46-
run: cargo codspeed run > /dev/null
47-
token: ${{ secrets.CODSPEED_TOKEN }}
48-
49-
memory-benchmarks:
50-
name: Run memory benchmarks (CodSpeed)
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@v6
54-
with:
55-
persist-credentials: false
56-
57-
- uses: dtolnay/rust-toolchain@stable
58-
59-
- uses: Swatinem/rust-cache@v2
60-
61-
- name: Install cargo-codspeed
62-
shell: bash
63-
run: cargo install cargo-codspeed --locked
64-
65-
- name: Build benchmarks for memory
66-
shell: bash
67-
run: cargo codspeed build
68-
69-
- name: Run memory benchmarks
70-
uses: CodSpeedHQ/action@v4
71-
env:
72-
CODSPEED_LOG: debug
73-
with:
74-
mode: memory
50+
mode: ${{ matrix.mode }}
7551
run: cargo codspeed run > /dev/null
7652
token: ${{ secrets.CODSPEED_TOKEN }}

0 commit comments

Comments
 (0)