mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
CI: Cache build folder on Windows
Since the initial `cmake -G "Visual Studio 17 2022" ..` seems to be a real bottleneck on the Windows CI (sometimes taking multiple minutes for seemingly no reason), cache the build folder based on the hash of CMakeLists.txt. It should be possible to reuse the build folder if CMakeLists hasn't changed, and if it does change (because someone adds a source file or library or something), we'll just do that initial cmake with -G once, and cache that version as well. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
This commit is contained in:
parent
62449dfa9a
commit
78c3696651
1 changed files with 16 additions and 1 deletions
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
|
@ -139,7 +139,17 @@ jobs:
|
||||||
Invoke-WebRequest "https://github.com/libsdl-org/SDL/releases/download/release-$env:SDL_VERSION/SDL2-devel-$env:SDL_VERSION-VC.zip" -o C:\SDL.zip
|
Invoke-WebRequest "https://github.com/libsdl-org/SDL/releases/download/release-$env:SDL_VERSION/SDL2-devel-$env:SDL_VERSION-VC.zip" -o C:\SDL.zip
|
||||||
Expand-Archive C:\SDL.zip -DestinationPath C:\
|
Expand-Archive C:\SDL.zip -DestinationPath C:\
|
||||||
|
|
||||||
- name: CMake configure (default version)
|
- name: Cache build folder for this CMakeLists.txt
|
||||||
|
id: cache-windows-build-folder
|
||||||
|
uses: actions/cache@v3
|
||||||
|
env:
|
||||||
|
cache-name: cache-windows-build-folder-VS2022
|
||||||
|
with:
|
||||||
|
path: desktop_version/build
|
||||||
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('desktop_version/CMakeLists.txt') }}-SDL${{ env.SDL_VERSION }}
|
||||||
|
|
||||||
|
- if: ${{ steps.cache-windows-build-folder.outputs.cache-hit != 'true' }}
|
||||||
|
name: CMake initial configure/generate
|
||||||
run: |
|
run: |
|
||||||
mkdir $env:SRC_DIR_PATH/build
|
mkdir $env:SRC_DIR_PATH/build
|
||||||
cd $env:SRC_DIR_PATH/build
|
cd $env:SRC_DIR_PATH/build
|
||||||
|
@ -147,6 +157,11 @@ jobs:
|
||||||
cmake -G "Visual Studio 17 2022" -A Win32 `
|
cmake -G "Visual Studio 17 2022" -A Win32 `
|
||||||
-DSDL2_INCLUDE_DIRS="C:\SDL2-$env:SDL_VERSION\include" `
|
-DSDL2_INCLUDE_DIRS="C:\SDL2-$env:SDL_VERSION\include" `
|
||||||
-DSDL2_LIBRARIES="SDL2;SDL2main" ..
|
-DSDL2_LIBRARIES="SDL2;SDL2main" ..
|
||||||
|
|
||||||
|
- name: CMake configure (default version)
|
||||||
|
run: |
|
||||||
|
cd $env:SRC_DIR_PATH/build
|
||||||
|
cmake ..
|
||||||
- name: Build (default version)
|
- name: Build (default version)
|
||||||
run: |
|
run: |
|
||||||
cd $env:SRC_DIR_PATH/build
|
cd $env:SRC_DIR_PATH/build
|
||||||
|
|
Loading…
Reference in a new issue