Skip to content

Commit 541e814

Browse files
committed
CI: Simplify and complete matrix setup
1 parent 3e453ed commit 541e814

File tree

1 file changed

+32
-44
lines changed

1 file changed

+32
-44
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,49 @@ jobs:
77
name: Check MSRV (1.71.0)
88
strategy:
99
matrix:
10-
include:
10+
target:
1111
- os: ubuntu-latest
12-
features: vulkan,hashbrown
13-
- os: ubuntu-latest
14-
features: vulkan,std
15-
- os: ubuntu-latest
16-
features: vulkan,std,hashbrown
17-
- os: windows-latest
18-
features: d3d12,hashbrown
12+
backend: vulkan
1913
- os: windows-latest
20-
features: d3d12,std
21-
- os: windows-latest
22-
features: d3d12,std,hashbrown
23-
- os: macos-latest
24-
features: metal,hashbrown
25-
- os: macos-latest
26-
features: metal,std
14+
backend: vulkan,d3d12
2715
- os: macos-latest
28-
features: metal,std,hashbrown
29-
runs-on: ${{ matrix.os }}
16+
backend: vulkan,metal
17+
features:
18+
- hashbrown
19+
- std
20+
- hashbrown,std
21+
runs-on: ${{ matrix.target.os }}
3022
steps:
3123
- uses: actions/checkout@v4
3224
- uses: dtolnay/rust-toolchain@nightly
3325
- name: Generate lockfile with minimal dependency versions
3426
run: cargo +nightly generate-lockfile -Zminimal-versions
3527
- uses: dtolnay/[email protected]
3628
# Note that examples are extempt from the MSRV check, so that they can use newer Rust features
37-
- run: cargo check --workspace --features ${{ matrix.features }} --no-default-features
29+
- run: cargo check --workspace --features ${{ matrix.target.backend }},${{ matrix.features }} --no-default-features
3830

3931
test:
4032
name: Test Suite
4133
strategy:
4234
matrix:
43-
include:
35+
target:
4436
- os: ubuntu-latest
45-
features: vulkan,visualizer,hashbrown
46-
- os: ubuntu-latest
47-
features: vulkan,visualizer,std
48-
- os: ubuntu-latest
49-
features: vulkan,visualizer,std,hashbrown
50-
- os: windows-latest
51-
features: d3d12,visualizer,public-winapi,hashbrown
37+
backend: vulkan
5238
- os: windows-latest
53-
features: d3d12,visualizer,public-winapi,std
54-
- os: windows-latest
55-
features: d3d12,visualizer,public-winapi,std,hashbrown
56-
- os: macos-latest
57-
features: metal,visualizer,hashbrown
58-
- os: macos-latest
59-
features: metal,visualizer,std
39+
backend: vulkan,d3d12
6040
- os: macos-latest
61-
features: metal,visualizer,std,hashbrown
62-
runs-on: ${{ matrix.os }}
41+
backend: vulkan,metal
42+
features:
43+
- hashbrown
44+
- std
45+
- hashbrown,std
46+
runs-on: ${{ matrix.target.os }}
6347
steps:
6448
- uses: actions/checkout@v4
6549
- name: Cargo test all targets
66-
run: cargo test --workspace --all-targets --features ${{ matrix.features }} --no-default-features
50+
run: cargo test --workspace --all-targets --features visualizer,${{ matrix.target.backend }},${{ matrix.features }} --no-default-features
6751
- name: Cargo test docs
68-
run: cargo test --workspace --doc --features ${{ matrix.features }} --no-default-features
52+
run: cargo test --workspace --doc --features visualizer,${{ matrix.target.backend }},${{ matrix.features }} --no-default-features
6953

7054
fmt:
7155
name: Rustfmt
@@ -79,26 +63,30 @@ jobs:
7963
name: Clippy
8064
strategy:
8165
matrix:
82-
include:
66+
target:
8367
- os: ubuntu-latest
84-
features: std,vulkan,visualizer
68+
backend: vulkan
8569
- os: windows-latest
86-
features: std,vulkan,visualizer,d3d12,public-winapi
70+
backend: vulkan,d3d12
8771
- os: macos-latest
88-
features: std,vulkan,visualizer,metal
89-
runs-on: ${{ matrix.os }}
72+
backend: vulkan,metal
73+
features:
74+
- hashbrown
75+
- std
76+
- hashbrown,std
77+
runs-on: ${{ matrix.target.os }}
9078
steps:
9179
- uses: actions/checkout@v4
9280
- name: Cargo clippy
93-
run: cargo clippy --workspace --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
81+
run: cargo clippy --workspace --all-targets --features visualizer,${{ matrix.target.backend }},${{ matrix.features }} --no-default-features -- -D warnings
9482

9583
doc:
9684
name: Build documentation
9785
strategy:
9886
matrix:
9987
# Rely on Windows and Mac to also compile the Vulkan portion (via --all-features)
10088
os: [windows-latest, macos-latest]
101-
runs-on: ${{ matrix.os }}
89+
runs-on: ${{ matrix.target.os }}
10290
env:
10391
RUSTDOCFLAGS: -Dwarnings
10492
steps:

0 commit comments

Comments
 (0)