Skip to content

Commit a7bd010

Browse files
authored
ci: parallelize unit test with matrix (#1833)
1 parent d7b2f1f commit a7bd010

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ jobs:
139139

140140
unit:
141141
runs-on: ubuntu-latest
142+
strategy:
143+
matrix:
144+
test-suite:
145+
- { name: "default", args: "--all-targets --all-features --workspace" }
146+
- { name: "smol", args: "--all-targets --no-default-features --features smol --features storage-all --workspace" }
147+
- { name: "doc", args: "--doc --all-features --workspace" }
148+
name: Unit Tests (${{ matrix.test-suite.name }})
142149
steps:
143150
- name: Maximize build space
144151
uses: easimon/maximize-build-space@master
@@ -163,15 +170,11 @@ jobs:
163170

164171
- name: Cache Rust artifacts
165172
uses: Swatinem/rust-cache@v2
173+
with:
174+
key: ${{ matrix.test-suite.name }}
166175

167176
- name: Test
168-
run: cargo test --no-fail-fast --all-targets --all-features --workspace
169-
170-
- name: Smol Test
171-
run: cargo test --no-fail-fast --all-targets --no-default-features --features "smol" --features "storage-all" --workspace
172-
173-
- name: Doc Test
174-
run: cargo test --no-fail-fast --doc --all-features --workspace
177+
run: cargo test --no-fail-fast ${{ matrix.test-suite.args }}
175178

176179
msrv:
177180
name: Verify MSRV

0 commit comments

Comments
 (0)