diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b28317f..db0d85c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -16,6 +16,21 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install MSVC Build Tools Insiders + if: runner.os == 'Windows' + shell: pwsh + run: | + $installer = Join-Path $env:TEMP 'vs_buildtools.exe' + Invoke-WebRequest -Uri 'https://aka.ms/vs/insiders/vs_buildtools.exe' -OutFile $installer + $process = Start-Process -FilePath $installer -ArgumentList ` + '--quiet','--wait','--norestart','--nocache', ` + '--add','Microsoft.VisualStudio.Workload.VCTools', ` + '--includeRecommended' -Wait -PassThru + $exitCode = $process.ExitCode + if ($exitCode -ne 0 -and $exitCode -ne 3010 -and $exitCode -ne 3015) { + throw "MSVC Build Tools Insiders installation failed with exit code $exitCode" + } + - name: Use GitHub Actions provided vcpkg shell: pwsh run: Add-Content "$env:GITHUB_ENV" "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c748460..fe4bd31 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,6 +29,21 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install MSVC Build Tools Insiders + if: runner.os == 'Windows' + shell: pwsh + run: | + $installer = Join-Path $env:TEMP 'vs_buildtools.exe' + Invoke-WebRequest -Uri 'https://aka.ms/vs/insiders/vs_buildtools.exe' -OutFile $installer + $process = Start-Process -FilePath $installer -ArgumentList ` + '--quiet','--wait','--norestart','--nocache', ` + '--add','Microsoft.VisualStudio.Workload.VCTools', ` + '--includeRecommended' -Wait -PassThru + $exitCode = $process.ExitCode + if ($exitCode -ne 0 -and $exitCode -ne 3010 -and $exitCode -ne 3015) { + throw "MSVC Build Tools Insiders installation failed with exit code $exitCode" + } + - name: Use GitHub Actions provided vcpkg shell: pwsh run: Add-Content "$env:GITHUB_ENV" "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT"