Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
47793be
ci: add ARM64 Windows runner support to workflows
krishnakumar4a4 Jul 9, 2025
d9f9324
ci: adapt for nuget wdk changes
krishnakumar4a4 Jul 30, 2025
86f6cb7
ci: replace winget install with powershell script
krishnakumar4a4 Jul 30, 2025
a1113a7
ci: remove unnecessary targets from certain workflows
krishnakumar4a4 Jul 30, 2025
4922ef9
debug: add PATH env variable printing and include tmate
krishnakumar4a4 Jul 31, 2025
631e301
debug: install winget using recommended method
krishnakumar4a4 Jul 31, 2025
165ce47
Revert "debug: install winget using recommended method"
krishnakumar4a4 Jul 31, 2025
5436c8d
Revert "debug: add PATH env variable printing and include tmate"
krishnakumar4a4 Jul 31, 2025
8ead94f
ci: skip certain jobs/steps when WDK is 10.0.22621 and runner is arm6…
krishnakumar4a4 Jul 31, 2025
0c2f544
ci: move to older way of installing winget
krishnakumar4a4 Aug 5, 2025
9e99c45
debug: modify winget-install to install latest winget using different…
krishnakumar4a4 Aug 5, 2025
9eff661
ci: add arm64 support for codeql and doc workflows
krishnakumar4a4 Aug 5, 2025
b827dc5
Update crates/cargo-wdk/tests/wdm-driver/src/lib.rs
krishnakumar4a4 Aug 5, 2025
f2fe66d
ci: add --all-targets back to cargo clippy and remove old comment
krishnakumar4a4 Aug 6, 2025
23b9b41
debug: add target_triple back to test and local-development-makefile …
krishnakumar4a4 Aug 6, 2025
119f307
ci: revert arm64 support for codeql
krishnakumar4a4 Aug 6, 2025
1ea9662
ci: revert target_triple from test workflow
krishnakumar4a4 Aug 6, 2025
6df0f87
ci: revert target_triple from wdk-pre-commit-hook workflow
krishnakumar4a4 Aug 6, 2025
5ae1a14
ci: centralized cert tools present check to env var in build workflow
krishnakumar4a4 Aug 6, 2025
55d5a5c
ci: make arch names consistent in workflows
krishnakumar4a4 Aug 6, 2025
c774633
ci: moved LLVM installation to an action
krishnakumar4a4 Aug 6, 2025
9f2480a
Apply suggestion from @gurry
krishnakumar4a4 Aug 6, 2025
3648b0a
Apply suggestion from @gurry
krishnakumar4a4 Aug 6, 2025
84e0bfd
ci: refactor winget-install action
krishnakumar4a4 Aug 6, 2025
e43884d
ci: move to windows-2025 for x64 as winget comes pre installed
krishnakumar4a4 Aug 6, 2025
e3b30f1
debug: include tmate to debug windows-2025 has certmgr.exe
krishnakumar4a4 Aug 7, 2025
978b2fe
Revert "debug: include tmate to debug windows-2025 has certmgr.exe"
krishnakumar4a4 Aug 7, 2025
a3f6119
Revert "ci: move to windows-2025 for x64 as winget comes pre installed"
krishnakumar4a4 Aug 7, 2025
ffed717
debug: revert linker fix from wdm-driver
krishnakumar4a4 Aug 7, 2025
4c2c3db
debug: remove linker fix from wdm driver template
krishnakumar4a4 Aug 7, 2025
db9a000
debug: revert target changes from test workflow to reprod linker issue
krishnakumar4a4 Aug 7, 2025
f5d3d9f
debug: coment out job exclusion criteria in test workflow
krishnakumar4a4 Aug 8, 2025
613d9d2
ci: revert changes to test workflow post debugging linker issue
krishnakumar4a4 Aug 8, 2025
6880f8a
ci: rename winget-install to install-winget for consistency
krishnakumar4a4 Aug 8, 2025
cc923ec
ci: refactor install-winget action temp path construction
krishnakumar4a4 Aug 8, 2025
c810cf5
ci: update comment for unable to install SDK scenario
krishnakumar4a4 Aug 12, 2025
ea30711
copilot: use tag instead of release number for winget installation
krishnakumar4a4 Aug 12, 2025
86462bd
ci: add sdk installation step to install-wdk action and also addresse…
krishnakumar4a4 Aug 12, 2025
c7cd0a5
ci: change installation method for 10.0.22621 SDK
krishnakumar4a4 Aug 13, 2025
def6187
ci: fix wdk and LLVM installation
krishnakumar4a4 Aug 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/actions/install-llvm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Install LLVM

inputs:
version:
description: "LLVM version to install"
required: true

runs:
using: "composite"
steps:
- name: Install LLVM ${{ inputs.version }}
shell: pwsh
run: |
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ inputs.version }}') {
Write-Host "LLVM ${{ inputs.version }} is already installed."
} else {
Write-Host "Installing LLVM ${{ inputs.version }}..."
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ inputs.version }} -Source winget -MatchOption Equals -Mode Silent -Force

# Check if WinGet installation succeeded
$installSuccess = $?
if (-not $installSuccess) {
Write-Error "LLVM installation failed. Last exit code: $LASTEXITCODE and success status: $installSuccess"
exit 1
}
}

clang --version
44 changes: 29 additions & 15 deletions .github/actions/install-wdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ runs:
- name: Install WDK
shell: pwsh
run: |
$hostArch = '${{ inputs.host }}'
$targetArch = '${{ inputs.target }}'
switch ($targetArch) {
'amd64' { $targetArch = 'x64' }
'arm64' { $targetArch = 'ARM64' }
default {
Write-Error "Invalid target architecture: $targetArch. Supported architectures are 'x64' and 'arm64'."
exit 1
# Function to normalize architecture names
function Normalize-Architecture($arch) {
switch ($arch.ToLower()) {
'amd64' { return 'x64' }
'arm64' { return 'arm64' }
default {
Write-Error "Invalid architecture: $arch. Supported architectures are 'amd64' and 'arm64'."
exit 1
}
}
}

$hostArch = Normalize-Architecture '${{ inputs.host }}'
$targetArch = Normalize-Architecture '${{ inputs.target }}'

$inputVersion = '${{ inputs.version }}'
if ($inputVersion -notmatch '^10\.0\.\d{5}(\.\d{1,4})?$') {
Expand Down Expand Up @@ -130,14 +134,24 @@ runs:
Write-Output "WindowsSdkBinPath=$packages\Microsoft.Windows.SDK.CPP.$version\c\bin" >> $env:GITHUB_ENV
} else {

Write-Host "Using Winget to install WDK version $inputVersion..."
Write-Host "Using Winget to install WDK and SDK version $inputVersion..."

$sdk = "Microsoft.WindowsSDK.$sdkVersion"
$wdk = "Microsoft.WindowsWDK.$inputVersion"
if ((Get-WinGetPackage -Id $wdk -Source winget -MatchOption Equals).Id -eq '$wdk') {
Write-Host "$wdk is already installed. Attempting to update..."
Update-WinGetPackage -Id $wdk -Source winget -MatchOption Equals -Mode Silent -Force
} else {
Write-Host "Installing $wdk..."
Install-WinGetPackage -Id $wdk -Source winget -MatchOption Equals -Mode Silent -Force
Write-Host "Installing $sdk..."
Install-WinGetPackage -Id $sdk -Source winget -MatchOption Equals -Mode Silent -Force -Override '/q /features +'
$installSuccess = $?
if (-not $installSuccess) {
Write-Error "$sdk installation failed. Last exit code: $LASTEXITCODE and success status: $installSuccess"
exit 1
}

Write-Host "Installing $wdk..."
Install-WinGetPackage -Id $wdk -Source winget -MatchOption Equals -Mode Silent -Force
$installSuccess = $?
if (-not $installSuccess) {
Write-Error "$wdk installation failed. Last exit code: $LASTEXITCODE and success status: $installSuccess"
exit 1
}

Write-Host "Setting Version_Number environment variable to $sdkVersion..."
Expand Down
81 changes: 81 additions & 0 deletions .github/actions/install-winget/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "Install Winget"
description: "Install winget on windows runners since its not installed by default: https://github.com/actions/runner-images/issues/6472"
inputs:
GITHUB_TOKEN:
description: "GitHub token to execute authenticated Github API requests (for higher rate limit)"
required: true
runs:
using: "composite"
steps:
- name: Get URIs for Winget v1.11.400 assets
shell: pwsh
run: |
$AuthenticatedHeaders = @{ "Authorization" = "Bearer ${{ inputs.GITHUB_TOKEN }}" }

# Detect runner architecture
$Architecture = if ($env:RUNNER_ARCH -eq "ARM64") { "arm64" } else { "x64" }
Write-Host "Runner architecture: $Architecture"

# winget-cli release v1.11.400
# Define the winget-cli release tag to use
$WingetReleaseTag = "v1.11.400"
# Fetch release info by tag instead of magic number release ID
$ReleaseInfo = Invoke-RestMethod -Headers $AuthenticatedHeaders "https://api.github.com/repos/microsoft/winget-cli/releases/tags/$WingetReleaseTag"
$WingetDownloadUri = $ReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('.msixbundle') }
$WingetLicenseDownloadUri = $ReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('License1.xml') }
$WingetDependenciesZipDownloadUri = $ReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('DesktopAppInstaller_Dependencies.zip') }

# Print to logs
Write-Host "WingetDownloadUri=$WingetDownloadUri"
Write-Host "WingetLicenseDownloadUri=$WingetLicenseDownloadUri"
Write-Host "WingetDependenciesZipDownloadUri=$WingetDependenciesZipDownloadUri"

# Save output for next step
Write-Output "WingetDownloadUri=$WingetDownloadUri" >> $env:GITHUB_ENV
Write-Output "WingetLicenseDownloadUri=$WingetLicenseDownloadUri" >> $env:GITHUB_ENV
Write-Output "Architecture=$Architecture" >> $env:GITHUB_ENV
Write-Output "WingetDependenciesZipDownloadUri=$WingetDependenciesZipDownloadUri" >> $env:GITHUB_ENV
Write-Output "InstallWingetTempDir=$env:RUNNER_TEMP/install-winget" >> $env:GITHUB_ENV

- name: Download Winget Assets and Dependencies
shell: pwsh
run: |
New-Item -Type Directory $env:InstallWingetTempDir

# Download winget and license (architecture-agnostic)
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:WingetDownloadUri -OutFile $env:InstallWingetTempDir/winget.msixbundle
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:WingetLicenseDownloadUri -OutFile $env:InstallWingetTempDir/license.xml
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:WingetDependenciesZipDownloadUri -OutFile $env:InstallWingetTempDir/DesktopAppInstaller_Dependencies.zip

Expand-Archive -Path "$env:InstallWingetTempDir/DesktopAppInstaller_Dependencies.zip" -DestinationPath $env:InstallWingetTempDir/ -Force

- name: Start Winget Installation for all Users
shell: pwsh
run: |
# Use architecture-specific dependency paths
[string[]]$DependencyPaths = (Get-ChildItem -Path "$env:InstallWingetTempDir/$env:Architecture" -Filter '*.appx' -File -Force).FullName

$MicrosoftUIXamlDep = $($DependencyPaths[0])
$MicrosoftVCLibsDep = $($DependencyPaths[1])

Write-Host "Found Dependency $MicrosoftUIXamlDep"
Write-Host "Found Dependency $MicrosoftVCLibsDep"

Add-AppxProvisionedPackage -Online -PackagePath $env:InstallWingetTempDir/winget.msixbundle -LicensePath $env:InstallWingetTempDir/license.xml -DependencyPackagePath "$MicrosoftUIXamlDep", "$MicrosoftVCLibsDep"

- name: Install Winget for Current User (for better install diagnostics)
shell: powershell
run: |
Add-AppxPackage $env:InstallWingetTempDir/winget.msixbundle

- name: Wait for Completion of Winget Installation
shell: pwsh
run: |
while ((Get-Command * | Select-String winget)?.ToString() -ne "winget.exe") {
Start-Sleep -Seconds 1
}
Write-Output "Winget Version: $(winget --version)"

- name: Install winget Powershell Module
shell: pwsh
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
56 changes: 0 additions & 56 deletions .github/actions/winget-install/action.yaml

This file was deleted.

26 changes: 14 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ env:
jobs:
build:
name: Build
runs-on: windows-latest
strategy:
fail-fast: false # Allow all matrix variants to complete even if some fail
matrix:
runner:
- name: windows-latest
arch: amd64
- name: windows-11-arm
arch: arm64

wdk:
- version: 10.0.22621 # NI WDK
source: winget
Expand All @@ -46,32 +51,29 @@ jobs:
arch: amd64
- name: aarch64-pc-windows-msvc
arch: arm64

runs-on: ${{ matrix.runner.name }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Winget
uses: ./.github/actions/winget-install
uses: ./.github/actions/install-winget
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
uses: ./.github/actions/install-llvm
with:
version: ${{ matrix.llvm }}

- name: Install WDK (${{ matrix.wdk.version }})
uses: ./.github/actions/install-wdk
with:
version: ${{ matrix.wdk.version }}
source: ${{ matrix.wdk.source }}
host: 'x64' # windows-latest is x64-based
host: ${{ matrix.runner.arch }}
target: ${{ matrix.target_triple.arch }}

- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
Expand All @@ -98,7 +100,7 @@ jobs:
- name: Package Examples (via Cargo Make)
run: cargo make --cwd ./examples package-driver-flow +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }}

# Run cargo-wdk on examples
# Run cargo-wdk on examples and tests
- name: Install cargo-wdk
run: cargo +${{ matrix.rust_toolchain }} install --path=crates/cargo-wdk --profile ${{ matrix.cargo_profile }} --locked --force

Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,21 @@ jobs:
uses: actions/checkout@v4

- name: Install Winget
uses: ./.github/actions/winget-install
uses: ./.github/actions/install-winget
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
uses: ./.github/actions/install-llvm
with:
version: ${{ matrix.llvm }}

- name: Install WDK (${{ matrix.wdk.version }})
uses: ./.github/actions/install-wdk
with:
version: ${{ matrix.wdk.version }}
source: ${{ matrix.wdk.source }}
host: 'x64' # windows-latest is x64-based
host: 'amd64' # windows-latest is x64-based
target: ${{ matrix.target_triple.arch }}

- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ env:
jobs:
docs:
name: Docs
runs-on: windows-latest
strategy:
fail-fast: false # Allow all matrix variants to complete even if some fail
matrix:
runner:
- name: windows-latest
arch: amd64
- name: windows-11-arm
arch: arm64

wdk:
- version: 10.0.22621 # NI WDK
source: winget
Expand All @@ -45,31 +50,28 @@ jobs:
- name: aarch64-pc-windows-msvc
arch: arm64

runs-on: ${{ matrix.runner.name }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Winget
uses: ./.github/actions/winget-install
uses: ./.github/actions/install-winget
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
uses: ./.github/actions/install-llvm
with:
version: ${{ matrix.llvm }}

- name: Install WDK (${{ matrix.wdk.version }})
uses: ./.github/actions/install-wdk
with:
version: ${{ matrix.wdk.version }}
source: ${{ matrix.wdk.source }}
host: 'x64' # windows-latest is x64-based
host: ${{ matrix.runner.arch }}
target: ${{ matrix.target_triple.arch }}

- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
Expand All @@ -83,6 +85,5 @@ jobs:
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --exclude wdk-macros --all-features

- name: Run Cargo Doc w/ proc-macro crates
if: matrix.target_triple.name == 'x86_64-pc-windows-msvc'
# cargo doc can only generate documentation for proc-macro crates when --target is not specified due to a cargo doc bug: https://github.com/rust-lang/cargo/issues/7677
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --all-features
Loading
Loading