Windows CI: Exit workflow on any errors; fix vcpkg caching #485
Workflow file for this run
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: Test Windows | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.7] | |
| env: | |
| VCPKG_ROOT: '${{ github.workspace }}/vcpkg' | |
| VCPKG_ASSET_SOURCES: "${{ github.workspace }}/vcpkgAssets" | |
| X_VCPKG_ASSET_SOURCES: clear;x-azurl,file:///${{ github.workspace }}/vcpkgAssets,,readwrite | |
| VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkgBin,readwrite | |
| VCPKG_BUILD_TREES: "${{ github.workspace }}/vcpkgBuild" | |
| VCPKG_INSTALLED_DIR: "${{ github.workspace }}/vcpkgInstalled" | |
| VCPKG_INSTALL_OPTIONS: "--x-buildtrees-root=${{ github.workspace }}/vcpkgBuild" | |
| VCPKG_DEFAULT_TRIPLET: 'x64-windows' | |
| VCPKG_DEFAULT_HOST_TRIPLET: 'x64-windows' | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Restore vcpkg cache | |
| id: cache-vcpkg-restore | |
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: | | |
| ${{ github.workspace }}\vcpkgAssets | |
| ${{ github.workspace }}\vcpkgBCache | |
| ${{ github.workspace }}\vcpkgBin | |
| ${{ github.workspace }}\vcpkgBuild | |
| key: vcpkgCache-${{ github.repository_owner }}-windows-latest-x64-windows-${{ hashFiles('.github/workflows/vcpkg.json') }} | |
| - name: Create directories on cache miss | |
| run: | | |
| New-Item -Force -ItemType Directory -Path "${{ github.workspace }}\vcpkgAssets" | |
| New-Item -Force -ItemType Directory -Path "${{ github.workspace }}\vcpkgBCache" | |
| New-Item -Force -ItemType Directory -Path "${{ github.workspace }}\vcpkgBin" | |
| New-Item -Force -ItemType Directory -Path "${{ github.workspace }}\vcpkgBuild" | |
| shell: pwsh | |
| if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0 | |
| - name: setup boost prerequisites | |
| uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6 | |
| with: | |
| vcpkgDirectory: '${{ github.workspace }}/vcpkg' | |
| binaryCachePath: "${{ github.workspace }}/vcpkgBCache" | |
| runVcpkgInstall: true | |
| vcpkgJsonGlob: .github/workflows/vcpkg.json | |
| - name: setup faber | |
| shell: pwsh | |
| run: | | |
| # Source - https://stackoverflow.com/a/9949105 | |
| # Posted by goric, modified by community. See post 'Timeline' for change history | |
| # Retrieved 2026-07-12, License - CC BY-SA 4.0 | |
| $ErrorActionPreference = "Stop" | |
| Set-StrictMode -Version Latest | |
| $PSNativeCommandUseErrorActionPreference = $true # might be true by default | |
| python -m pip install --upgrade pip | |
| python -m pip install setuptools faber numpy | |
| faber --info=tools cxx | |
| - name: build | |
| shell: pwsh | |
| run: | | |
| # Source - https://stackoverflow.com/a/9949105 | |
| # Posted by goric, modified by community. See post 'Timeline' for change history | |
| # Retrieved 2026-07-12, License - CC BY-SA 4.0 | |
| $ErrorActionPreference = "Stop" | |
| Set-StrictMode -Version Latest | |
| $PSNativeCommandUseErrorActionPreference = $true # might be true by default | |
| faber --builddir=build cxx.name=msvc --log=commands --log=output --with-boost-include="${{ github.workspace }}/vcpkgInstalled/x64-windows/include" -j4 | |
| - name: test | |
| shell: pwsh | |
| run: | | |
| # Source - https://stackoverflow.com/a/9949105 | |
| # Posted by goric, modified by community. See post 'Timeline' for change history | |
| # Retrieved 2026-07-12, License - CC BY-SA 4.0 | |
| $ErrorActionPreference = "Stop" | |
| Set-StrictMode -Version Latest | |
| $PSNativeCommandUseErrorActionPreference = $true # might be true by default | |
| faber --builddir=build cxx.name=msvc --with-boost-include="${{ github.workspace }}/vcpkgInstalled/x64-windows/include" -j4 test.report | |
| - name: Save vcpkg cache | |
| id: cache-vcpkg-save | |
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: | | |
| ${{ github.workspace }}\vcpkgAssets | |
| ${{ github.workspace }}\vcpkgBCache | |
| ${{ github.workspace }}\vcpkgBin | |
| ${{ github.workspace }}\vcpkgBuild | |
| key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} | |
| if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' |