Cache vcpkg binary archives instead of vcpkg_installed #11
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: Build Spectrum | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: windows-2025-vs2026 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Cache vcpkg dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.LOCALAPPDATA }}\vcpkg\archives | |
| key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} | |
| restore-keys: | | |
| vcpkg-${{ runner.os }}- | |
| - name: Install vcpkg dependencies | |
| shell: cmd | |
| run: vcpkg install --triplet x64-windows | |
| - name: Setup project | |
| shell: cmd | |
| run: setup.bat | |
| - name: Generate Visual Studio projects | |
| shell: cmd | |
| run: generate_project.bat | |
| - name: Integrate vcpkg with MSBuild | |
| shell: cmd | |
| run: vcpkg integrate install | |
| - name: Debug vcpkg include folders | |
| shell: cmd | |
| run: dir /s /b vcpkg_installed\x64-windows\x64-windows\include\ 2>nul || echo "vcpkg_installed not found" | |
| - name: Add msbuild to PATH | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Build solution | |
| run: msbuild ./projects/spectrum.sln /p:Configuration=Retail /p:Platform=x64 /m | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: build-output | |
| path: | | |
| ./workdir/ | |
| ./projects/ | |
| retention-days: 7 |