Skip to content

Commit b6ae722

Browse files
committed
fix: windows ci caching
1 parent c1ee205 commit b6ae722

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -109,54 +109,62 @@ jobs:
109109
build-windows:
110110
runs-on: windows-latest
111111
needs: release
112+
env:
113+
VULKAN_VERSION: 1.2.198.1
114+
QT_VERSION: 6.9.0
112115
steps:
113116
- uses: actions/checkout@v4
114117

115-
- name: Install Dependencies
116-
run: choco install aqt
118+
- name: Cache Vulkan SDK
119+
id: cache-vulkan
120+
uses: actions/cache@v4
121+
with:
122+
path: ./VULKAN_SDK
123+
key: vulkan-${{ env.VULKAN_VERSION }}
117124

118125
- name: Setup Vulkan SDK
126+
if: steps.cache-vulkan.outputs.cache-hit != 'true'
119127
uses: humbletim/setup-vulkan-sdk@v1.2.0
120128
with:
121-
vulkan-query-version: 1.2.198.1
122-
123-
- name: Install QT and Modules
124-
run: aqt install-qt --outputdir "${{ github.workspace }}\qt-6.8.1" windows desktop 6.8.1 win64_mingw -m all
129+
vulkan-query-version: ${{ env.VULKAN_VERSION }}
125130

126-
- name: Setup MSYS2
127-
id: msys2
128-
uses: msys2/setup-msys2@v2.27.0
131+
- name: Cache QT
132+
id: cache-qt
133+
uses: actions/cache@v4
129134
with:
130-
msystem: mingw64
131-
install: mingw-w64-x86_64-gcc ninja cmake git
132-
path-type: inherit
135+
path: ./qt
136+
key: vulkan-${{ env.QT_VERSION }}
137+
138+
- name: Install AQT
139+
if: steps.cache-vulkan.outputs.cache-hit != 'true'
140+
run: choco install aqt
141+
142+
- name: Install QT and Modules
143+
if: steps.cache-vulkan.outputs.cache-hit != 'true'
144+
run: aqt install-qt --outputdir "${{ github.workspace }}\qt" windows desktop ${{ env.QT_VERSION }} win64_msvc2022_64 -m all
133145

134146
- name: Configure CMake
135147
run: >
136148
cmake -B "${{ github.workspace }}\build"
137-
-G Ninja
138-
-DCMAKE_MAKE_PROGRAM="${{ steps.msys2.outputs.msys2-location }}\usr\bin\ninja.exe"
139-
-DCMAKE_PREFIX_PATH="./qt-6.8.1/6.8.1/mingw_64/lib/cmake"
149+
-DCMAKE_PREFIX_PATH=".\qt\${{ env.QT_VERSION }}\msvc2022_64\lib\cmake"
140150
-DCMAKE_BUILD_TYPE=Release
141-
-DCMAKE_CXX_COMPILER="${{ steps.msys2.outputs.msys2-location }}\mingw64\bin\g++.exe"
142-
-DCMAKE_C_COMPILER="${{ steps.msys2.outputs.msys2-location }}\mingw64\bin\g++.exe"
143151
-S .
144152
145153
- name: Build Tests
146154
run: cmake --build "${{ github.workspace }}\build" --config Release --target unlogic-test
147155

148156
- name: Run Tests
149-
run: ./build/unlogic/unlogic-test.exe --gtest_shuffle
157+
run: .\build\unlogic\Release\unlogic-test.exe --gtest_shuffle
150158

151159
- name: Build Calculator
152160
run: cmake --build "${{ github.workspace }}\build" --config Release --target unlogic-calculator
153161

154162
- shell: msys2 {0}
155163
name: Create Release Package
156164
run: >
157-
./qt-6.8.1/6.8.1/mingw_64/bin/windeployqt ./build/calculator/unlogic-calculator.exe --dir ./build/calculator/package
158-
mv ./build/calculator/unlogic-calculator.exe ./build/calculator/package
159-
zip ./build/calculator/package
165+
.\qt\${{ env.QT_VERSION}}\msvc2022_64\bin\windeployqt .\build\calculator\Release\unlogic-calculator.exe --dir .\build\calculator\package
166+
mv .\build\calculator\Release\unlogic-calculator.exe .\build\calculator\package
167+
7z .\build\calculator\package.zip .\build\calculator\package
160168
161169
- name: Upload Build Artefacts
162170
if: startsWith(github.ref, 'refs/tags/v')

0 commit comments

Comments
 (0)