Skip to content

Commit 26fa7fb

Browse files
ci: adopt arm64 changes from WDR as-is
1 parent b9aa8bb commit 26fa7fb

File tree

4 files changed

+113
-142
lines changed

4 files changed

+113
-142
lines changed

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

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

.github/workflows/build.yaml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,20 @@ env:
1515
jobs:
1616
build:
1717
name: Build
18-
runs-on: windows-latest
1918
strategy:
2019
fail-fast: false # Allow all matrix variants to complete even if some fail
2120
matrix:
21+
runner:
22+
- name: windows-latest
23+
arch: amd64
24+
- name: windows-11-arm
25+
arch: arm64
26+
2227
wdk:
23-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
28+
- version: 10.0.22621 # NI WDK
29+
source: winget
30+
- version: 10.0.26100 # GE WDK
31+
source: nuget
2432

2533
llvm:
2634
- 17.0.6
@@ -40,34 +48,29 @@ jobs:
4048
- name: aarch64-pc-windows-msvc
4149
arch: arm64
4250

51+
runs-on: ${{ matrix.runner.name }}
52+
4353
steps:
4454
- name: Checkout Repository
4555
uses: actions/checkout@v4
4656

4757
- name: Install Winget
48-
uses: ./.github/actions/winget-install
58+
uses: ./.github/actions/install-winget
4959
with:
5060
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5161

5262
- 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
61-
62-
- 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-
}
63+
uses: ./.github/actions/install-llvm
64+
with:
65+
version: ${{ matrix.llvm }}
66+
67+
- name: Install WDK (${{ matrix.wdk.version }})
68+
uses: ./.github/actions/install-wdk
69+
with:
70+
version: ${{ matrix.wdk.version }}
71+
source: ${{ matrix.wdk.source }}
72+
host: ${{ matrix.runner.arch }}
73+
target: ${{ matrix.target_triple.arch }}
7174

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

.github/workflows/docs.yaml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ env:
1313
jobs:
1414
docs:
1515
name: Docs
16-
runs-on: windows-latest
1716
strategy:
1817
matrix:
18+
runner:
19+
- name: windows-latest
20+
arch: amd64
21+
- name: windows-11-arm
22+
arch: arm64
23+
1924
wdk:
20-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
25+
- version: 10.0.22621 # NI WDK
26+
source: winget
27+
- version: 10.0.26100 # GE WDK
28+
source: nuget
2129

2230
llvm:
2331
- 17.0.6
@@ -32,59 +40,56 @@ jobs:
3240
- release
3341

3442
target_triple:
35-
- x86_64-pc-windows-msvc
36-
- aarch64-pc-windows-msvc
43+
- name: x86_64-pc-windows-msvc
44+
arch: amd64
45+
- name: aarch64-pc-windows-msvc
46+
arch: arm64
47+
48+
runs-on: ${{ matrix.runner.name }}
3749

3850
steps:
3951
- name: Checkout Repository
4052
uses: actions/checkout@v4
4153

4254
- name: Install Winget
43-
uses: ./.github/actions/winget-install
55+
uses: ./.github/actions/install-winget
4456
with:
4557
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4658

4759
- name: Install LLVM ${{ matrix.llvm }}
48-
run: |
49-
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
50-
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
51-
} else {
52-
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
53-
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
54-
}
55-
clang --version
56-
57-
- name: Install WDK (${{ matrix.wdk }})
58-
run: |
59-
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
60-
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
61-
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
62-
} else {
63-
Write-Host "Installing ${{ matrix.wdk }}..."
64-
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
65-
}
60+
uses: ./.github/actions/install-llvm
61+
with:
62+
version: ${{ matrix.llvm }}
63+
64+
- name: Install WDK (${{ matrix.wdk.version }})
65+
uses: ./.github/actions/install-wdk
66+
with:
67+
version: ${{ matrix.wdk.version }}
68+
source: ${{ matrix.wdk.source }}
69+
host: ${{ matrix.runner.arch }}
70+
target: ${{ matrix.target_triple.arch }}
6671

6772
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
6873
uses: dtolnay/rust-toolchain@master
6974
with:
7075
toolchain: ${{ matrix.rust_toolchain }}
71-
targets: ${{ matrix.target_triple }}
76+
targets: ${{ matrix.target_triple.name }}
7277

7378
- name: Run Cargo Doc
7479
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
75-
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros
80+
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --exclude wdk-macros
7681

7782
- name: Run Cargo Doc (--features nightly)
7883
if: matrix.rust_toolchain == 'nightly'
7984
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
80-
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros --features nightly
85+
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --exclude wdk-macros --features nightly
8186

8287
- name: Run Cargo Doc w/ proc-macro crates
83-
if: matrix.target_triple == 'x86_64-pc-windows-msvc'
88+
if: matrix.target_triple.name == 'x86_64-pc-windows-msvc'
8489
# 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
8590
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }}
8691

8792
- name: Run Cargo Doc w/ proc-macro crates (--features nightly)
88-
if: ${{ matrix.target_triple == 'x86_64-pc-windows-msvc' && matrix.rust_toolchain == 'nightly' }}
93+
if: ${{ matrix.target_triple.name == 'x86_64-pc-windows-msvc' && matrix.rust_toolchain == 'nightly' }}
8994
# 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
9095
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --features nightly

.github/workflows/lint.yaml

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,21 @@ name: Lint
1010
jobs:
1111
clippy:
1212
name: Clippy
13-
runs-on: windows-latest
1413
permissions:
1514
checks: write
1615
strategy:
1716
matrix:
17+
runner:
18+
- name: windows-latest
19+
arch: amd64
20+
- name: windows-11-arm
21+
arch: arm64
22+
1823
wdk:
19-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
24+
- version: 10.0.22621 # NI WDK
25+
source: winget
26+
- version: 10.0.26100 # GE WDK
27+
source: nuget
2028

2129
llvm:
2230
- 17.0.6
@@ -31,37 +39,34 @@ jobs:
3139
- release
3240

3341
target_triple:
34-
- x86_64-pc-windows-msvc
35-
- aarch64-pc-windows-msvc
42+
- name: x86_64-pc-windows-msvc
43+
arch: amd64
44+
- name: aarch64-pc-windows-msvc
45+
arch: arm64
46+
47+
runs-on: ${{ matrix.runner.name }}
3648

3749
steps:
3850
- name: Checkout Repository
3951
uses: actions/checkout@v4
4052

4153
- name: Install Winget
42-
uses: ./.github/actions/winget-install
54+
uses: ./.github/actions/install-winget
4355
with:
4456
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4557

4658
- name: Install LLVM ${{ matrix.llvm }}
47-
run: |
48-
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
49-
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
50-
} else {
51-
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
52-
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
53-
}
54-
clang --version
55-
56-
- name: Install WDK (${{ matrix.wdk }})
57-
run: |
58-
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
59-
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
60-
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
61-
} else {
62-
Write-Host "Installing ${{ matrix.wdk }}..."
63-
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
64-
}
59+
uses: ./.github/actions/install-llvm
60+
with:
61+
version: ${{ matrix.llvm }}
62+
63+
- name: Install WDK (${{ matrix.wdk.version }})
64+
uses: ./.github/actions/install-wdk
65+
with:
66+
version: ${{ matrix.wdk.version }}
67+
source: ${{ matrix.wdk.source }}
68+
host: ${{ matrix.runner.arch }}
69+
target: ${{ matrix.target_triple.arch }}
6570

6671
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
6772
uses: dtolnay/rust-toolchain@master
@@ -71,38 +76,52 @@ jobs:
7176
targets: ${{ matrix.target_triple }}
7277

7378
- name: Run Cargo Clippy
74-
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-targets -- -D warnings
79+
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --all-targets -- -D warnings
7580

7681
- name: Run Cargo Clippy (--features nightly)
7782
if: matrix.rust_toolchain == 'nightly'
78-
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --all-targets --features nightly -- -D warnings
83+
run: cargo +${{ matrix.rust_toolchain }} clippy --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --all-targets --features nightly -- -D warnings
7984

8085
machete:
8186
name: Detect Unused Cargo Dependencies
82-
runs-on: windows-latest
8387
strategy:
8488
matrix:
89+
runner:
90+
- name: windows-latest
91+
arch: amd64
92+
- name: windows-11-arm
93+
arch: arm64
94+
8595
wdk:
86-
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
96+
- version: 10.0.22621 # NI WDK
97+
source: winget
98+
- version: 10.0.26100 # GE WDK
99+
source: nuget
100+
101+
target_triple:
102+
- name: x86_64-pc-windows-msvc
103+
arch: amd64
104+
- name: aarch64-pc-windows-msvc
105+
arch: arm64
106+
107+
runs-on: ${{ matrix.runner.name }}
87108

88109
steps:
89110
- name: Checkout Repository
90111
uses: actions/checkout@v4
91112

92113
- name: Install Winget
93-
uses: ./.github/actions/winget-install
114+
uses: ./.github/actions/install-winget
94115
with:
95116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96117

97-
- name: Install WDK (${{ matrix.wdk }})
98-
run: |
99-
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
100-
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
101-
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
102-
} else {
103-
Write-Host "Installing ${{ matrix.wdk }}..."
104-
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
105-
}
118+
- name: Install WDK (${{ matrix.wdk.version }})
119+
uses: ./.github/actions/install-wdk
120+
with:
121+
version: ${{ matrix.wdk.version }}
122+
source: ${{ matrix.wdk.source }}
123+
host: ${{ matrix.runner.arch }}
124+
target: ${{ matrix.target_triple.arch }}
106125

107126
- name: Install Rust Toolchain
108127
uses: dtolnay/rust-toolchain@stable

0 commit comments

Comments
 (0)