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 $Env:Path += $ChocoPath
} }
# GitHub Actions uses an image that comes with most dependencies preinstalled. Don't install them twice.
choco install -y "visualstudio${VsVersion}community" if (-not $Env:GITHUB_ACTIONS) {
ThrowOnNativeFailure choco install -y `
"visualstudio${VsVersion}community" `
choco install -y "visualstudio${VsVersion}-workload-netcoretools" "visualstudio${VsVersion}-workload-netcoretools" `
ThrowOnNativeFailure "visualstudio${VsVersion}-workload-vctools" `
"visualstudio${VsVersion}-workload-manageddesktop" `
choco install -y "visualstudio${VsVersion}-workload-vctools" "visualstudio${VsVersion}-workload-nativedesktop" `
ThrowOnNativeFailure "visualstudio${VsVersion}-workload-universal" `
"visualstudio${VsVersion}buildtools" `
choco install -y "visualstudio${VsVersion}-workload-manageddesktop" git `
ThrowOnNativeFailure cmake `
winflexbison3 `
choco install -y "visualstudio${VsVersion}-workload-nativedesktop" windows-sdk-8.1 `
ThrowOnNativeFailure wixtoolset
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-universal" } else {
ThrowOnNativeFailure choco install -y winflexbison3
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
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}" 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 # Execute vcvars in cmd and store env
$vcvars_locations = @( $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}\Community\VC\Auxiliary\Build\vcvars${bits}.bat"
"${VSBASE}\Enterprise\VC\Auxiliary\Build\vcvars${bits}.bat"
) )
$vcvars = $null $vcvars = $null