Skip to content

feat: enable CI workflows to use NuGet WDK packages #784

feat: enable CI workflows to use NuGet WDK packages

feat: enable CI workflows to use NuGet WDK packages #784

on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: "0 11 * * *"
name: Local Development Makefile
env:
RUSTFLAGS: -D warnings
jobs:
build:
name: Test WDR's local cargo-make Makefile
runs-on: windows-latest
strategy:
matrix:
wdk:
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
- 10.0.26100.1
llvm:
- 17.0.6
target_triple:
- x86_64-pc-windows-msvc
# - aarch64-pc-windows-msvc FIXME: find a way to validate the local makefile on aarch64
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Winget
uses: ./.github/actions/winget-install
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install LLVM ${{ matrix.llvm }}
run: |
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
} else {
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
}
clang --version
- name: Install WDK (${{ matrix.wdk }})
if: matrix.wdk == 'Microsoft.WindowsWDK.10.0.22621'
run: |
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
} else {
Write-Host "Installing ${{ matrix.wdk }}..."
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
}
- name: Install ${{ matrix.wdk }} (NuGet)
if: startsWith(matrix.wdk, '10.0.')
run: |
$wdk = '${{ matrix.wdk }}'
if ($wdk -match '^10\.0\.\d{5}\.\d{1,4}$') {
./.github/scripts/nuget-install-wdk.ps1 -wdkVersion $wdk
} else {
Write-Host "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}"
exit 1
}
- name: Install Nightly Rust Toolchain (${{ matrix.target_triple }})
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
targets: ${{ matrix.target_triple }}
- name: Install Beta Rust Toolchain (${{ matrix.target_triple }})
uses: dtolnay/rust-toolchain@beta
with:
components: clippy
targets: ${{ matrix.target_triple }}
- name: Install Stable Rust Toolchain (${{ matrix.target_triple }})
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: ${{ matrix.target_triple }}
- name: Install Cargo Make
uses: taiki-e/install-action@v2
with:
tool: cargo-make
- name: Test wdk-pre-commit-flow cargo-make task
run: cargo make wdk-pre-commit-flow