Repository navigation
Update CI runners to *-latest and refresh vcpkg baseline #357
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows | |
| on: [push, pull_request] | |
| jobs: | |
| vs2026: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: ['x86', 'x64'] | |
| libs: ['shared', 'static'] | |
| config: ['Debug', 'Release'] | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - name: Set target triplet | |
| id: set-variables | |
| shell: pwsh | |
| run: echo "vcpkg_triplet=${{ matrix.arch }}-windows$(if ('${{ matrix.libs }}' -eq 'static') { '-static' })" >> $env:GITHUB_OUTPUT | |
| - name: Cache vcpkg | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| id: cache-vcpkg | |
| with: | |
| path: build/vcpkg_cache/ | |
| key: vcpkg-binaries-${{ steps.set-variables.outputs.vcpkg_triplet }} | |
| - name: Create Build Environment | |
| if: ${{ !steps.cache-vcpkg.outputs.cache-hit }} | |
| run: | | |
| cmake -E make_directory build | |
| cmake -E make_directory build/vcpkg_cache | |
| - name: Configure | |
| shell: pwsh | |
| working-directory: build/ | |
| run: | | |
| $vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT '.\scripts\buildsystems\vcpkg.cmake' -Resolve | |
| $vcpkgTriplet = '${{ steps.set-variables.outputs.vcpkg_triplet }}' | |
| $cmakeSharedLibs = $(if ('${{ matrix.libs }}' -eq 'shared') { 'ON' } else { 'OFF' }) | |
| $msbuildArch = $(if ('${{ matrix.arch }}' -eq 'x64') { 'X64' } else { 'Win32' }) | |
| $cachedBinaries = Join-Path $(Get-Location) './vcpkg_cache/' -Resolve | |
| $cacheAccess = $(if ('${{ steps.cache-vcpkg.outputs.cache-hit }}' -eq 'true') { 'read' } else { 'write' }) | |
| $env:VCPKG_BINARY_SOURCES = "clear;files,$cachedBinaries,$cacheAccess" | |
| cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DVCPKG_TARGET_TRIPLET=$vcpkgTriplet" "-DBUILD_SHARED_LIBS=$cmakeSharedLibs" -G "Visual Studio 18 2026" -A "$msbuildArch" ${{ github.workspace }} | |
| - name: Build | |
| working-directory: build/ | |
| run: cmake --build . --config ${{ matrix.config }} -j -v | |
| - name: Test | |
| working-directory: build/ | |
| run: ctest -C ${{ matrix.config }} --output-on-failure |