mirror of
https://github.com/actions/runner-images.git
synced 2025-12-18 07:46:57 +00:00
[windows] Pin the cmake version to 3.31.6 (#11936)
* [windows] Pin the cmake version to 3.31.6 * [windows] adjust choco script * Fix choco build failure * Add version parameter to choco script
This commit is contained in:
committed by
GitHub
parent
5efa00f978
commit
68d05af296
@@ -6,7 +6,7 @@
|
|||||||
$commonPackages = (Get-ToolsetContent).choco.common_packages
|
$commonPackages = (Get-ToolsetContent).choco.common_packages
|
||||||
|
|
||||||
foreach ($package in $commonPackages) {
|
foreach ($package in $commonPackages) {
|
||||||
Install-ChocoPackage $package.name -ArgumentList $package.args
|
Install-ChocoPackage $package.name -Version $package.version -ArgumentList $package.args
|
||||||
}
|
}
|
||||||
|
|
||||||
Invoke-PesterTests -TestFile "ChocoPackages"
|
Invoke-PesterTests -TestFile "ChocoPackages"
|
||||||
|
|||||||
@@ -16,8 +16,11 @@ function Install-ChocoPackage {
|
|||||||
.PARAMETER RetryCount
|
.PARAMETER RetryCount
|
||||||
The number of times to retry the installation if it fails. Default is 5.
|
The number of times to retry the installation if it fails. Default is 5.
|
||||||
|
|
||||||
|
.PARAMETER Version
|
||||||
|
The version of the package to install.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Install-ChocoPackage -PackageName "git" -RetryCount 3
|
Install-ChocoPackage -PackageName "git" -Version "2.39.2" -RetryCount 3
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
@@ -25,6 +28,7 @@ function Install-ChocoPackage {
|
|||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
[string] $PackageName,
|
[string] $PackageName,
|
||||||
[string[]] $ArgumentList,
|
[string[]] $ArgumentList,
|
||||||
|
[string] $Version,
|
||||||
[int] $RetryCount = 5
|
[int] $RetryCount = 5
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -32,8 +36,11 @@ function Install-ChocoPackage {
|
|||||||
$count = 1
|
$count = 1
|
||||||
while ($true) {
|
while ($true) {
|
||||||
Write-Host "Running [#$count]: choco install $packageName -y $argumentList"
|
Write-Host "Running [#$count]: choco install $packageName -y $argumentList"
|
||||||
choco install $packageName -y @argumentList --no-progress --require-checksums
|
if ($Version) {
|
||||||
|
choco install $packageName --version $Version -y @ArgumentList --no-progress --require-checksums
|
||||||
|
} else {
|
||||||
|
choco install $packageName -y @ArgumentList --no-progress --require-checksums
|
||||||
|
}
|
||||||
$pkg = choco list --localonly $packageName --exact --all --limitoutput
|
$pkg = choco list --localonly $packageName --exact --all --limitoutput
|
||||||
if ($pkg) {
|
if ($pkg) {
|
||||||
Write-Host "Package installed: $pkg"
|
Write-Host "Package installed: $pkg"
|
||||||
|
|||||||
@@ -416,6 +416,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "cmake.install",
|
"name": "cmake.install",
|
||||||
|
"version": "3.31.6",
|
||||||
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
|
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
|
||||||
},
|
},
|
||||||
{ "name": "imagemagick" },
|
{ "name": "imagemagick" },
|
||||||
|
|||||||
@@ -337,6 +337,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "cmake.install",
|
"name": "cmake.install",
|
||||||
|
"version": "3.31.6",
|
||||||
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
|
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
|
||||||
},
|
},
|
||||||
{ "name": "imagemagick" },
|
{ "name": "imagemagick" },
|
||||||
|
|||||||
@@ -292,6 +292,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "cmake.install",
|
"name": "cmake.install",
|
||||||
|
"version": "3.31.6",
|
||||||
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
|
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user