Skip to content

Commit

Permalink
ci: pin LLVM version in pipelines (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmmc88 authored Jun 18, 2024
1 parent afbc3b7 commit d9cc309
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/actions/winget-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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)'
description: "GitHub token to execute authenticated Github API requests (for higher rate limit)"
required: true
runs:
using: "composite"
Expand Down Expand Up @@ -45,3 +45,7 @@ runs:
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
21 changes: 19 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
wdk:
- Microsoft.WindowsWDK.10.0.22621 # NI WDK

llvm:
- 17.0.6

rust_toolchain:
- stable
- beta
Expand All @@ -41,10 +44,24 @@ jobs:
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 }})
run: |
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) {
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }}
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 Rust Toolchain (${{ matrix.rust_toolchain }})
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/code-formatting-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ jobs:
uses: actions/checkout@v4

- name: Install Rust Toolchain (Nightly)
# 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
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-02-17
components: rustfmt

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

taplo-fmt:
name: .toml Formatting Check
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:

name: Docs

env:
RUSTDOCFLAGS: -D warnings

jobs:
docs:
name: Docs
Expand All @@ -16,6 +19,9 @@ jobs:
wdk:
- Microsoft.WindowsWDK.10.0.22621 # NI WDK

llvm:
- 17.0.6

rust_toolchain:
- stable
- beta
Expand All @@ -38,10 +44,24 @@ jobs:
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 }})
run: |
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) {
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }}
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 Rust Toolchain (${{ matrix.rust_toolchain }})
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
wdk:
- Microsoft.WindowsWDK.10.0.22621 # NI WDK

llvm:
- 17.0.6

rust_toolchain:
- stable
- beta
Expand All @@ -40,10 +43,24 @@ jobs:
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 }})
run: |
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) {
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }}
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 Rust Toolchain (${{ matrix.rust_toolchain }})
Expand Down Expand Up @@ -90,7 +107,7 @@ jobs:
- name: Install Cargo Udeps
uses: taiki-e/install-action@v2
with:
tool: cargo-udeps
tool: cargo-udeps@0.1.48

- name: Run Cargo Udeps
run: cargo +nightly udeps --locked --all-targets
Expand Down

0 comments on commit d9cc309

Please sign in to comment.