Skip to content

Commit 0a3a3cd

Browse files
chore: use cargo-wdk to build & package samples on the CI pipeline (microsoft#36)
2 parents 9c20eb3 + 45bc035 commit 0a3a3cd

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/build.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
name: Build
1818
runs-on: windows-latest
1919
strategy:
20+
fail-fast: false # Allow all matrix variants to complete even if some fail
2021
matrix:
2122
wdk:
2223
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
@@ -34,8 +35,10 @@ jobs:
3435
- release
3536

3637
target_triple:
37-
- x86_64-pc-windows-msvc
38-
- aarch64-pc-windows-msvc
38+
- name: x86_64-pc-windows-msvc
39+
arch: amd64
40+
- name: aarch64-pc-windows-msvc
41+
arch: arm64
3942

4043
steps:
4144
- name: Checkout Repository
@@ -70,15 +73,24 @@ jobs:
7073
uses: dtolnay/rust-toolchain@master
7174
with:
7275
toolchain: ${{ matrix.rust_toolchain }}
73-
targets: ${{ matrix.target_triple }}
76+
targets: ${{ matrix.target_triple.name }}
7477

7578
- name: Run Cargo Build
76-
run: cargo +${{ matrix.rust_toolchain }} build --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace
79+
run: cargo +${{ matrix.rust_toolchain }} build --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace
7780

81+
# Steps to use cargo-make to build and package drivers
7882
- name: Install Cargo Make
7983
uses: taiki-e/install-action@v2
8084
with:
8185
tool: cargo-make
8286

8387
- name: Build and Package Sample Drivers
84-
run: cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}
88+
run: cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }}
89+
90+
# Steps to use cargo-wdk to build and package drivers (uses cargo-wdk at specific commit https://github.com/microsoft/windows-drivers-rs/commit/5b9aa0a14e385daf5217c0f5232bcd4d3f4780a6)
91+
- name: Install cargo-wdk binary
92+
run: cargo +${{ matrix.rust_toolchain }} install --git https://github.com/microsoft/windows-drivers-rs.git cargo-wdk --branch main --rev 5b9aa0a14e385daf5217c0f5232bcd4d3f4780a6 --locked --force
93+
94+
- name: Build and Package Sample Drivers with cargo-wdk
95+
run: cargo +${{ matrix.rust_toolchain }} wdk build --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_triple.arch }}
96+
continue-on-error: true # cargo-wdk build fails for a known reason

0 commit comments

Comments
 (0)