summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/windows_build.yml17
1 files changed, 13 insertions, 4 deletions
diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml
index 3daccd3..4819b62 100644
--- a/.github/workflows/windows_build.yml
+++ b/.github/workflows/windows_build.yml
@@ -28,13 +28,21 @@ jobs:
standalone: OFF
steps:
- uses: actions/checkout@v4
+ - name: Cache vcpkg
+ uses: actions/cache@v4
+ with:
+ key: ${{ runner.os }}-vcpkg-x64-windows-static-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-vcpkg-x64-windows-static-
+ path: D:/a/vcpkg
- name: Build Visual Studio
if: ${{ matrix.generate == 'Visual Studio 17 2022' }}
+ env:
+ VCPKG_ROOT: D:/a/vcpkg
run: |
# Enable the viewer in CI (BUILD_UI is off by default), except on Win32:
- # libultraship is x64-only. Its automate-vcpkg bootstraps the runner's
- # vcpkg to fetch SDL2/GLEW/libzip/nlohmann-json/tinyxml2/spdlog.
- $env:VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT
+ # libultraship is x64-only. Its automate-vcpkg bootstraps vcpkg to
+ # fetch SDL2/GLEW/libzip/nlohmann-json/tinyxml2/spdlog.
cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} -DBUILD_UI=${{ matrix.arch == 'Win32' && 'OFF' || 'ON' }} -DUSE_AUTO_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static
# Multi-config generator: pass --config, else it builds Debug and the
# Release artifact path below finds nothing.
@@ -46,11 +54,12 @@ jobs:
arch: ${{ matrix.arch }}
- name: Build Ninja
if: ${{ matrix.generate == 'Ninja' }}
+ env:
+ VCPKG_ROOT: D:/a/vcpkg
run: |
# Enable the viewer in CI, off on Win32 (libultraship is x64-only). Ninja
# is single-platform, so name the vcpkg triplet explicitly (there is no
# CMAKE_VS_PLATFORM_NAME for automate-vcpkg to key off).
- $env:VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT
cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} -DBUILD_UI=${{ matrix.arch == 'Win32' && 'OFF' || 'ON' }} -DUSE_AUTO_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static
cmake --build ./build/${{ matrix.arch }}
- name: Publish packaged artifacts