GitHub Actions: Use preinstalled dependencies on Windows

The Windows image provided by GitHub already includes most of our dependencies,
so the installation of all Chocolatey packages except winflexbison3 was
redundant. Visual Studio is provided in the Enterprise version instead of
Community, so that has to be added to the search path as well.
This commit is contained in:
Julian Brost 2022-01-10 16:52:13 +01:00
parent 3d04b04172
commit 8e766a6a47
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