-
Notifications
You must be signed in to change notification settings - Fork 124
ci: stress-test Install-PSResource with expanded LLVM matrix #626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d276479
1db099a
b70e684
208562d
0464426
ddea1c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -110,26 +110,35 @@ runs: | |||||
| run: | | ||||||
| Set-StrictMode -Version Latest | ||||||
|
|
||||||
| # Use Install-PSResource (PSResourceGet, built into PowerShell 7.4+) instead of the | ||||||
| # legacy Install-Module. PSResourceGet has its own repository system that is independent | ||||||
| # of the old PowerShellGet/NuGet pipeline, which avoids transient PSGallery registration | ||||||
| # failures on freshly provisioned runners. | ||||||
| # See https://github.com/actions/runner-images/issues/13758 | ||||||
| if (-not (Get-PSResourceRepository -Name PSGallery -ErrorAction SilentlyContinue)) { | ||||||
| Register-PSResourceRepository -PSGallery -Trusted | ||||||
| } | ||||||
|
|
||||||
| $cliVersion = (winget --version).Trim() -replace '^v', '' | ||||||
| $cliMajor = ($cliVersion -split '\.')[0] | ||||||
| Write-Host "WinGet CLI version: $cliVersion (major: $cliMajor)" | ||||||
|
|
||||||
| # Try exact match first, then best matching major version, then latest | ||||||
| $matchingModule = Find-Module -Name Microsoft.WinGet.Client -Repository PSGallery -RequiredVersion $cliVersion -ErrorAction SilentlyContinue | ||||||
| if ($matchingModule) { | ||||||
| Write-Host "Installing exact matching module version: $cliVersion" | ||||||
| Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -RequiredVersion $cliVersion -Force | ||||||
| $found = Find-PSResource -Name Microsoft.WinGet.Client -Repository PSGallery -Version $cliVersion -ErrorAction SilentlyContinue | ||||||
| if ($found) { | ||||||
| Write-Host "Installing exact matching module version: $cliVersion" | ||||||
| Install-PSResource -Name Microsoft.WinGet.Client -Repository PSGallery -Version $cliVersion -TrustRepository -Quiet | ||||||
|
Comment on lines
+127
to
+130
|
||||||
| } else { | ||||||
| $allVersions = Find-Module -Name Microsoft.WinGet.Client -Repository PSGallery -AllVersions -ErrorAction SilentlyContinue | ||||||
| $majorMatch = $allVersions | Where-Object { ($_.Version.ToString() -split '\.')[0] -eq $cliMajor } | Select-Object -First 1 | ||||||
| if ($majorMatch) { | ||||||
| Write-Host "Exact match not found. Installing latest module with matching major version: $($majorMatch.Version)" | ||||||
| Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -RequiredVersion $majorMatch.Version -Force | ||||||
| } else { | ||||||
| Write-Warning "No module with major version $cliMajor found on PSGallery. Installing latest version." | ||||||
| Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force | ||||||
| } | ||||||
| $allVersions = Find-PSResource -Name Microsoft.WinGet.Client -Repository PSGallery -Version "[$cliMajor.0.0, $([int]$cliMajor + 1).0.0)" -ErrorAction SilentlyContinue | ||||||
| if ($allVersions) { | ||||||
| $best = ($allVersions | Sort-Object Version -Descending | Select-Object -First 1).Version | ||||||
| Write-Host "Exact match not found. Installing latest module with matching major version: $best" | ||||||
| Install-PSResource -Name Microsoft.WinGet.Client -Repository PSGallery -Version $best -TrustRepository -Quiet | ||||||
| } else { | ||||||
| Write-Warning "No module with major version $cliMajor found on PSGallery. Installing latest version." | ||||||
| Install-PSResource -Name Microsoft.WinGet.Client -Repository PSGallery -TrustRepository -Quiet | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| $moduleVersion = (Get-InstalledModule Microsoft.WinGet.Client).Version.ToString() | ||||||
| $moduleVersion = (Get-Module -ListAvailable Microsoft.WinGet.Client | Select-Object -First 1).Version.ToString() | ||||||
|
||||||
| $moduleVersion = (Get-Module -ListAvailable Microsoft.WinGet.Client | Select-Object -First 1).Version.ToString() | |
| $moduleVersion = (Get-Module -ListAvailable Microsoft.WinGet.Client | Sort-Object Version -Descending | Select-Object -First 1).Version.ToString() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,9 @@ jobs: | |
|
|
||
| llvm: | ||
| - 17.0.6 | ||
| - 19.1.7 | ||
| - 20.1.8 | ||
| - 21.1.2 | ||
|
|
||
| rust_toolchain: | ||
| - stable | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,9 @@ jobs: | |
|
|
||
| llvm: | ||
| - 17.0.6 | ||
| - 19.1.7 | ||
| - 20.1.8 | ||
| - 21.1.2 | ||
|
|
||
| rust_toolchain: | ||
| - stable | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,9 @@ jobs: | |
|
|
||
| llvm: | ||
| - 17.0.6 | ||
| - 19.1.7 | ||
| - 20.1.8 | ||
| - 21.1.2 | ||
|
|
||
| rust_toolchain: | ||
| - stable | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,9 @@ jobs: | |
|
|
||
| llvm: | ||
| - 17.0.6 | ||
| - 19.1.7 | ||
| - 20.1.8 | ||
| - 21.1.2 | ||
|
|
||
| runs-on: ${{ matrix.runner.name }} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,9 @@ jobs: | |
|
|
||
| llvm: | ||
| - 17.0.6 | ||
| - 19.1.7 | ||
| - 20.1.8 | ||
| - 21.1.2 | ||
|
Comment on lines
34
to
+38
|
||
|
|
||
| rust_toolchain: | ||
| - stable | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,9 +30,9 @@ This project was built with support of WDM, KMDF, and UMDF drivers in mind, as w | |||||
| ### Build Requirements | ||||||
|
|
||||||
| * Binding generation via `bindgen` requires `libclang`. The easiest way to acquire this is via `winget` | ||||||
| * `winget install -i LLVM.LLVM --version 17.0.6 --force` | ||||||
| * `winget install -i LLVM.LLVM` | ||||||
| * Ensure you select the GUI option to add LLVM to the PATH | ||||||
| * LLVM 18 has a bug that causes bindings to fail to generate for ARM64. Continue using LLVM 17 until LLVM 19 comes out with [the fix](https://github.com/llvm/llvm-project/pull/93235). See [this](https://github.com/rust-lang/rust-bindgen/issues/2842) for more details. | ||||||
| * See list of [tested/supported versions](https://github.com/microsoft/windows-drivers-rs/blob/main/.github/workflows/build.yaml#L39) in the [CI workflow](./.github/workflows/build.yaml) | ||||||
|
||||||
| * See list of [tested/supported versions](https://github.com/microsoft/windows-drivers-rs/blob/main/.github/workflows/build.yaml#L39) in the [CI workflow](./.github/workflows/build.yaml) | |
| * See list of [tested/supported versions](https://github.com/microsoft/windows-drivers-rs/blob/main/.github/workflows/build.yaml) in the [CI workflow](./.github/workflows/build.yaml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes PSResourceGet cmdlets (
Get-PSResourceRepository/Find-PSResource/Install-PSResource) are available (PowerShell 7.4+ per the comment). If the runner executes this action under Windows PowerShell 5.1 or older PowerShell 7.x, the action will fail immediately. Add an explicit version/cmdlet availability check and either (a) install/enable PSResourceGet first, or (b) fall back to the previousInstall-Modulepath when PSResourceGet isn't available.See below for a potential fix: