Skip to content

Commit e9793d1

Browse files
chore: reduce unnecessary matrix for taget_arch and combine it with target_triple
1 parent 4453a52 commit e9793d1

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

.github/workflows/build.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ jobs:
3434
- release
3535

3636
target_triple:
37-
- x86_64-pc-windows-msvc
38-
- aarch64-pc-windows-msvc
39-
40-
target_arch:
41-
- x64
42-
- arm64
37+
- name: x86_64-pc-windows-msvc
38+
arch: x64
39+
- name: aarch64-pc-windows-msvc
40+
arch: arm64
4341

4442
steps:
4543
- name: Checkout Repository
@@ -74,19 +72,19 @@ jobs:
7472
uses: dtolnay/rust-toolchain@master
7573
with:
7674
toolchain: ${{ matrix.rust_toolchain }}
77-
targets: ${{ matrix.target_triple }}
75+
targets: ${{ matrix.target_triple.name }}
7876

7977
- name: Run Cargo Build
80-
run: cargo +${{ matrix.rust_toolchain }} build --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace
78+
run: cargo +${{ matrix.rust_toolchain }} build --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace
8179

8280
# Steps to use cargo-wdk to build and package drivers (skipping for arm64 as the base runner image is x86_64)
8381
- name: Install cargo-wdk binary
84-
if: ${{ matrix.target_arch != 'arm64' }}
85-
run: cargo +${{ matrix.rust_toolchain }} install --git https://github.com/svasista-ms/windows-drivers-rs.git cargo-wdk --branch integrate-cargo-wdk --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --force
82+
if: ${{ matrix.target_triple.arch != 'arm64' }}
83+
run: cargo +${{ matrix.rust_toolchain }} install --git https://github.com/svasista-ms/windows-drivers-rs.git cargo-wdk --branch integrate-cargo-wdk --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --force
8684

8785
- name: Build and Package Sample Drivers in the workspace with cargo-wdk
88-
if: ${{ matrix.target_arch != 'arm64' }}
89-
run: cargo +${{ matrix.rust_toolchain }} wdk build --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_arch }}
86+
if: ${{ matrix.target_triple.arch != 'arm64' }}
87+
run: cargo +${{ matrix.rust_toolchain }} wdk build --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_triple.arch }}
9088

9189
# Steps to use cargo-make to build and package drivers
9290
- name: Install Cargo Make
@@ -95,4 +93,4 @@ jobs:
9593
tool: cargo-make
9694

9795
- name: Build and Package Sample Drivers
98-
run: cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}
96+
run: cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }}

0 commit comments

Comments
 (0)