mirror of
https://github.com/actions/runner-images.git
synced 2026-01-04 01:03:18 +08:00
[Windows] Merge several toolset provisioners into single Configure-Toolset script (#1111)
* Add Configure-Toolset for windows * Set error action preference to stop * Move toolcache.json to config folder * Fix in verbose * Rename toolsets folder * Move default version functions from install-toolset to configure-toolset * Rework Configure-Toolset * Fix typo and remove empty line * Fix issues * Fix parameters in helpers * Fix helper syntax * Rename defaultVariable
This commit is contained in:
@@ -75,34 +75,11 @@ $toolsExecutables = @{
|
||||
$tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache
|
||||
|
||||
foreach($tool in $tools) {
|
||||
$toolPath = Join-Path $env:AGENT_TOOLSDIRECTORY $tool.name
|
||||
# Get executables for current tool
|
||||
$toolExecs = $toolsExecutables[$tool.name]
|
||||
|
||||
foreach ($version in $tool.versions) {
|
||||
# Add wildcard if missing
|
||||
if ($version.Split(".").Length -lt 3) {
|
||||
$version += ".*"
|
||||
}
|
||||
|
||||
# Check if version folder exists
|
||||
$expectedVersionPath = Join-Path $toolPath $version
|
||||
if (-not (Test-Path $expectedVersionPath)) {
|
||||
Write-Host "Expected $($tool.name) $version folder is not found!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Take latest installed version in case if toolset version contains wildcards
|
||||
$foundVersion = Get-Item $expectedVersionPath `
|
||||
| Sort-Object -Property {[version]$_.name} -Descending `
|
||||
| Select-Object -First 1
|
||||
|
||||
# Check for required architecture folder
|
||||
$foundVersionArchPath = Join-Path $foundVersion $tool.arch
|
||||
if (-not (Test-Path $foundVersionArchPath)) {
|
||||
Write-Host "Expected $($tool.name)($($tool.arch)) $($foundVersion.name) architecture folder is not found!"
|
||||
exit 1
|
||||
}
|
||||
$foundVersionArchPath = Get-ToolsetToolFullPath -Name $tool.name -Version $version -Arch $tool.arch
|
||||
|
||||
if ($toolExecs) {
|
||||
Write-Host "Run validation test for $($tool.name)($($tool.arch)) $($foundVersion.name) executables..."
|
||||
|
||||
Reference in New Issue
Block a user