Skip to content

Commit 9d6d266

Browse files
committed
Merge branch 'main' into cancel-in-progress
2 parents afd69c1 + f8a5baa commit 9d6d266

12 files changed

Lines changed: 351 additions & 435 deletions

File tree

.github/actions/winget-install/action.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ env:
1919
jobs:
2020
build:
2121
name: Build
22-
runs-on: windows-latest
22+
runs-on: windows-2025
2323
strategy:
2424
fail-fast: false # Allow all matrix variants to complete even if some fail
2525
matrix:
2626
wdk:
27-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
27+
- 10.0.22621 # NI WDK
2828

2929
llvm:
3030
- 17.0.6
@@ -48,30 +48,39 @@ jobs:
4848
- name: Checkout Repository
4949
uses: actions/checkout@v4
5050

51+
- name: Checkout windows-drivers-rs actions
52+
uses: actions/checkout@v4
53+
with:
54+
repository: microsoft/windows-drivers-rs
55+
ref: main
56+
path: _temp/windows-drivers-rs
57+
sparse-checkout: |
58+
.github/actions
59+
sparse-checkout-cone-mode: false
60+
61+
- name: Copy actions to workspace
62+
shell: pwsh
63+
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
64+
5165
- name: Install Winget
52-
uses: ./.github/actions/winget-install
66+
uses: ./.github/actions/install-winget
5367
with:
5468
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5569

70+
- name: Install Winget PowerShell Module
71+
shell: pwsh
72+
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
73+
5674
- name: Install LLVM ${{ matrix.llvm }}
57-
run: |
58-
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
59-
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
60-
} else {
61-
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
62-
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
63-
}
64-
clang --version
75+
uses: ./.github/actions/install-llvm
76+
with:
77+
version: ${{ matrix.llvm }}
6578

6679
- name: Install WDK (${{ matrix.wdk }})
67-
run: |
68-
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
69-
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
70-
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
71-
} else {
72-
Write-Host "Installing ${{ matrix.wdk }}..."
73-
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
74-
}
80+
uses: ./.github/actions/install-wdk
81+
with:
82+
version: ${{ matrix.wdk }}
83+
source: winget
7584

7685
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
7786
uses: dtolnay/rust-toolchain@master
@@ -91,9 +100,9 @@ jobs:
91100
- name: Build and Package Sample Drivers
92101
run: cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }}
93102

94-
# 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)
103+
# Steps to use cargo-wdk to build and package drivers
95104
- name: Install cargo-wdk binary
96-
run: cargo +${{ matrix.rust_toolchain }} install --git https://github.com/microsoft/windows-drivers-rs.git cargo-wdk --branch main --rev 5b9aa0a14e385daf5217c0f5232bcd4d3f4780a6 --locked --force
105+
run: cargo +${{ matrix.rust_toolchain }} install cargo-wdk --locked --force
97106

98107
- name: Build and Package Sample Drivers with cargo-wdk
99108
run: cargo +${{ matrix.rust_toolchain }} wdk build --sample --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_triple.arch }}

.github/workflows/cargo-audit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717
jobs:
1818
cargo_audit:
1919
name: Cargo Audit
20-
runs-on: windows-latest
20+
runs-on: windows-2025
2121
permissions:
2222
issues: write
2323
checks: write

.github/workflows/code-formatting-check.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ concurrency:
1414
jobs:
1515
cargo-fmt:
1616
name: .rs Formatting Check
17-
runs-on: windows-latest
17+
runs-on: windows-2025
1818

1919
steps:
2020
- name: Checkout Repository
2121
uses: actions/checkout@v4
2222

2323
- name: Install Rust Toolchain (Nightly)
2424
uses: dtolnay/rust-toolchain@nightly
25-
with:
25+
with:
2626
components: rustfmt
2727

2828
- name: Run Cargo Format
2929
run: cargo +nightly fmt --all -- --check
3030

3131
taplo-fmt:
3232
name: .toml Formatting Check
33-
runs-on: windows-latest
33+
runs-on: windows-2025
3434

3535
steps:
3636
- name: Checkout Repository

.github/workflows/docs.yaml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ env:
1717
jobs:
1818
docs:
1919
name: Docs
20-
runs-on: windows-latest
20+
runs-on: windows-2025
2121
strategy:
2222
fail-fast: false # Allow all matrix variants to complete even if some fail
2323
matrix:
2424
wdk:
25-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
25+
- 10.0.22621 # NI WDK
2626

2727
llvm:
2828
- 17.0.6
@@ -44,30 +44,39 @@ jobs:
4444
- name: Checkout Repository
4545
uses: actions/checkout@v4
4646

47+
- name: Checkout windows-drivers-rs actions
48+
uses: actions/checkout@v4
49+
with:
50+
repository: microsoft/windows-drivers-rs
51+
ref: main
52+
path: _temp/windows-drivers-rs
53+
sparse-checkout: |
54+
.github/actions
55+
sparse-checkout-cone-mode: false
56+
57+
- name: Copy actions to workspace
58+
shell: pwsh
59+
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
60+
4761
- name: Install Winget
48-
uses: ./.github/actions/winget-install
62+
uses: ./.github/actions/install-winget
4963
with:
5064
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5165

66+
- name: Install Winget PowerShell Module
67+
shell: pwsh
68+
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
69+
5270
- name: Install LLVM ${{ matrix.llvm }}
53-
run: |
54-
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
55-
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
56-
} else {
57-
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
58-
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
59-
}
60-
clang --version
71+
uses: ./.github/actions/install-llvm
72+
with:
73+
version: ${{ matrix.llvm }}
6174

6275
- name: Install WDK (${{ matrix.wdk }})
63-
run: |
64-
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
65-
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
66-
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
67-
} else {
68-
Write-Host "Installing ${{ matrix.wdk }}..."
69-
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
70-
}
76+
uses: ./.github/actions/install-wdk
77+
with:
78+
version: ${{ matrix.wdk }}
79+
source: winget
7180

7281
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
7382
uses: dtolnay/rust-toolchain@master

.github/workflows/lint.yaml

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ concurrency:
1414
jobs:
1515
clippy:
1616
name: Clippy
17-
runs-on: windows-latest
17+
runs-on: windows-2025
1818
permissions:
1919
checks: write
2020
strategy:
2121
fail-fast: false # Allow all matrix variants to complete even if some fail
2222
matrix:
2323
wdk:
24-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
24+
- 10.0.22621 # NI WDK
2525

2626
llvm:
2727
- 17.0.6
@@ -43,30 +43,39 @@ jobs:
4343
- name: Checkout Repository
4444
uses: actions/checkout@v4
4545

46+
- name: Checkout windows-drivers-rs actions
47+
uses: actions/checkout@v4
48+
with:
49+
repository: microsoft/windows-drivers-rs
50+
ref: main
51+
path: _temp/windows-drivers-rs
52+
sparse-checkout: |
53+
.github/actions
54+
sparse-checkout-cone-mode: false
55+
56+
- name: Copy actions to workspace
57+
shell: pwsh
58+
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
59+
4660
- name: Install Winget
47-
uses: ./.github/actions/winget-install
61+
uses: ./.github/actions/install-winget
4862
with:
4963
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5064

65+
- name: Install Winget PowerShell Module
66+
shell: pwsh
67+
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
68+
5169
- name: Install LLVM ${{ matrix.llvm }}
52-
run: |
53-
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
54-
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
55-
} else {
56-
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
57-
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
58-
}
59-
clang --version
70+
uses: ./.github/actions/install-llvm
71+
with:
72+
version: ${{ matrix.llvm }}
6073

6174
- name: Install WDK (${{ matrix.wdk }})
62-
run: |
63-
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
64-
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
65-
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
66-
} else {
67-
Write-Host "Installing ${{ matrix.wdk }}..."
68-
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
69-
}
75+
uses: ./.github/actions/install-wdk
76+
with:
77+
version: ${{ matrix.wdk }}
78+
source: winget
7079

7180
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
7281
uses: dtolnay/rust-toolchain@master
@@ -84,30 +93,44 @@ jobs:
8493

8594
machete:
8695
name: Detect Unused Cargo Dependencies
87-
runs-on: windows-latest
96+
runs-on: windows-2025
8897
strategy:
8998
matrix:
9099
wdk:
91-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
100+
- 10.0.22621 # NI WDK
92101

93102
steps:
94103
- name: Checkout Repository
95104
uses: actions/checkout@v4
96105

106+
- name: Checkout windows-drivers-rs actions
107+
uses: actions/checkout@v4
108+
with:
109+
repository: microsoft/windows-drivers-rs
110+
ref: main
111+
path: _temp/windows-drivers-rs
112+
sparse-checkout: |
113+
.github/actions
114+
sparse-checkout-cone-mode: false
115+
116+
- name: Copy actions to workspace
117+
shell: pwsh
118+
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
119+
97120
- name: Install Winget
98-
uses: ./.github/actions/winget-install
121+
uses: ./.github/actions/install-winget
99122
with:
100123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101124

125+
- name: Install Winget PowerShell Module
126+
shell: pwsh
127+
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
128+
102129
- name: Install WDK (${{ matrix.wdk }})
103-
run: |
104-
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
105-
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
106-
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
107-
} else {
108-
Write-Host "Installing ${{ matrix.wdk }}..."
109-
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
110-
}
130+
uses: ./.github/actions/install-wdk
131+
with:
132+
version: ${{ matrix.wdk }}
133+
source: winget
111134

112135
- name: Install Rust Toolchain
113136
uses: dtolnay/rust-toolchain@stable

0 commit comments

Comments
 (0)