Merge pull request #9172 from Icinga/feature/github-actions-windows-preinstalled-deps

GitHub Actions: Use preinstalled dependencies on Windows
This commit is contained in:
Alexander Aleksandrovič Klimov 2022-01-11 16:32:54 +01:00 committed by GitHub
commit 506b7d9a35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 38 deletions

View File

@ -70,43 +70,26 @@ try {
$Env:Path += $ChocoPath
}
choco install -y "visualstudio${VsVersion}community"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-netcoretools"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-vctools"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-manageddesktop"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-nativedesktop"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-universal"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}buildtools"
ThrowOnNativeFailure
choco install -y git
ThrowOnNativeFailure
choco install -y cmake
ThrowOnNativeFailure
choco install -y winflexbison3
ThrowOnNativeFailure
choco install -y windows-sdk-8.1
ThrowOnNativeFailure
choco install -y wixtoolset
ThrowOnNativeFailure
# GitHub Actions uses an image that comes with most dependencies preinstalled. Don't install them twice.
if (-not $Env:GITHUB_ACTIONS) {
choco install -y `
"visualstudio${VsVersion}community" `
"visualstudio${VsVersion}-workload-netcoretools" `
"visualstudio${VsVersion}-workload-vctools" `
"visualstudio${VsVersion}-workload-manageddesktop" `
"visualstudio${VsVersion}-workload-nativedesktop" `
"visualstudio${VsVersion}-workload-universal" `
"visualstudio${VsVersion}buildtools" `
git `
cmake `
winflexbison3 `
windows-sdk-8.1 `
wixtoolset
ThrowOnNativeFailure
} else {
choco install -y winflexbison3
ThrowOnNativeFailure
}
Install-Exe -Url "https://packages.icinga.com/windows/dependencies/boost_$($BoostVersion -join '_')-msvc-${MsvcVersion}-${Env:BITS}.exe" -Dir "C:\local\boost_$($BoostVersion -join '_')-Win${Env:BITS}"

View File

@ -29,8 +29,9 @@ if (Test-Path env:BITS) {
# Execute vcvars in cmd and store env
$vcvars_locations = @(
"${VSBASE}\BuildTools\VC\Auxiliary\Build\vcvars${bits}.bat",
"${VSBASE}\BuildTools\VC\Auxiliary\Build\vcvars${bits}.bat"
"${VSBASE}\Community\VC\Auxiliary\Build\vcvars${bits}.bat"
"${VSBASE}\Enterprise\VC\Auxiliary\Build\vcvars${bits}.bat"
)
$vcvars = $null