Skip to content

Commit d9cc309

Browse files
authored
ci: pin LLVM version in pipelines (#19)
1 parent afbc3b7 commit d9cc309

File tree

5 files changed

+68
-12
lines changed

5 files changed

+68
-12
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Install Winget"
22
description: "Install winget on windows runners since its not installed by default: https://github.com/actions/runner-images/issues/6472"
33
inputs:
44
GITHUB_TOKEN:
5-
description: 'GitHub token to execute authenticated Github API requests (for higher rate limit)'
5+
description: "GitHub token to execute authenticated Github API requests (for higher rate limit)"
66
required: true
77
runs:
88
using: "composite"
@@ -45,3 +45,7 @@ runs:
4545
Start-Sleep -Seconds 1
4646
}
4747
Write-Output "Winget Version: $(winget --version)"
48+
49+
- name: Install winget Powershell Module
50+
shell: pwsh
51+
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force

.github/workflows/build.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
wdk:
2020
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
2121

22+
llvm:
23+
- 17.0.6
24+
2225
rust_toolchain:
2326
- stable
2427
- beta
@@ -41,10 +44,24 @@ jobs:
4144
with:
4245
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4346

47+
- 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+
4457
- name: Install WDK (${{ matrix.wdk }})
4558
run: |
46-
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) {
47-
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }}
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
4865
}
4966
5067
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Install Rust Toolchain (Nightly)
20-
# Need to temporarily pin nightly used for fmt because of upstream bug: https://github.com/rust-lang/rustfmt/issues/6082, https://github.com/rust-lang/rustfmt/issues/6099
21-
uses: dtolnay/rust-toolchain@master
20+
uses: dtolnay/rust-toolchain@nightly
2221
with:
23-
toolchain: nightly-2024-02-17
2422
components: rustfmt
2523

2624
- name: Run Cargo Format
27-
run: cargo +nightly-2024-02-17 fmt --all -- --check
25+
run: cargo +nightly fmt --all -- --check
2826

2927
taplo-fmt:
3028
name: .toml Formatting Check

.github/workflows/docs.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77

88
name: Docs
99

10+
env:
11+
RUSTDOCFLAGS: -D warnings
12+
1013
jobs:
1114
docs:
1215
name: Docs
@@ -16,6 +19,9 @@ jobs:
1619
wdk:
1720
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
1821

22+
llvm:
23+
- 17.0.6
24+
1925
rust_toolchain:
2026
- stable
2127
- beta
@@ -38,10 +44,24 @@ jobs:
3844
with:
3945
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4046

47+
- 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+
4157
- name: Install WDK (${{ matrix.wdk }})
4258
run: |
43-
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) {
44-
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }}
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
4565
}
4666
4767
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})

.github/workflows/lint.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
wdk:
1919
- Microsoft.WindowsWDK.10.0.22621 # NI WDK
2020

21+
llvm:
22+
- 17.0.6
23+
2124
rust_toolchain:
2225
- stable
2326
- beta
@@ -40,10 +43,24 @@ jobs:
4043
with:
4144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4245

46+
- 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+
4356
- name: Install WDK (${{ matrix.wdk }})
4457
run: |
45-
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) {
46-
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }}
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
4764
}
4865
4966
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
@@ -90,7 +107,7 @@ jobs:
90107
- name: Install Cargo Udeps
91108
uses: taiki-e/install-action@v2
92109
with:
93-
tool: cargo-udeps
110+
tool: cargo-udeps@0.1.48
94111

95112
- name: Run Cargo Udeps
96113
run: cargo +nightly udeps --locked --all-targets

0 commit comments

Comments
 (0)