Skip to content

Commit c81f80b

Browse files
Merge #675
675: run tests in CI r=jswrenn a=danieleades - refactors the CI workflow to group targets by action (check or test) rather than by toolchain - converts the 'check' targets into a unified matrix target - adds a 'test' target to run the tests in CI - runs the checks in parallel instead of in sequence - adds an '--all-targets' check on stable to check the bench and test targets outstanding questions- - are all of these matrix targets needed, or can this be trimmed down further? I believe merging this will unblock adding configuration to allow dependabot to bump rust deps in this repo, since the CI will catch breaking changes in dev dependencies with these changes. see #674 Co-authored-by: Daniel Eades <[email protected]>
2 parents ca31484 + 403c93a commit c81f80b

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

.github/workflows/ci.yml

+31-14
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,49 @@ on:
88
- trying
99

1010
jobs:
11-
msrv:
12-
name: Rust MSRV
11+
check:
12+
name: check
1313
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
build: [msrv, stable]
17+
features:
18+
[
19+
"",
20+
"--no-default-features",
21+
"--no-default-features --features use_alloc",
22+
"--all-targets --all-features",
23+
]
24+
include:
25+
- build: msrv
26+
rust: 1.62.1
27+
- build: stable
28+
rust: stable
29+
exclude:
30+
- build: msrv
31+
# we only care about the MSRV with respect to the lib target
32+
features: "--all-targets --all-features"
1433
steps:
15-
- uses: actions/checkout@v2
16-
- uses: dtolnay/rust-toolchain@1.36.0
17-
- run: cargo check --no-default-features
18-
- run: cargo check --no-default-features --features "use_alloc"
19-
- run: cargo check
34+
- uses: actions/checkout@v3
35+
- uses: dtolnay/rust-toolchain@master
36+
with:
37+
toolchain: ${{ matrix.rust }}
38+
- run: cargo check ${{ matrix.features }}
2039

21-
stable:
22-
name: Rust Stable
40+
test:
41+
name: test
2342
runs-on: ubuntu-latest
2443
steps:
25-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v3
2645
- uses: dtolnay/rust-toolchain@stable
27-
- run: cargo check --no-default-features
28-
- run: cargo check --no-default-features --features "use_alloc"
29-
- run: cargo test
46+
- run: cargo test --all-features
3047

3148
# https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
3249
end-success:
3350
name: bors build finished
3451
if: success()
3552
runs-on: ubuntu-latest
36-
needs: [msrv,stable]
53+
needs: [check, test]
3754

3855
steps:
3956
- name: Mark the job as successful

0 commit comments

Comments
 (0)