@@ -3,7 +3,45 @@ name: Windows
33on : [push, pull_request]
44
55jobs :
6+
7+ tools :
8+ runs-on : windows-2022
9+ strategy :
10+ matrix :
11+ CMAKE : [3.22.0]
12+ NINJA : [1.10.2]
13+ env :
14+ CMAKE_URL : https://github.com/Kitware/CMake/releases/download/v${{matrix.CMAKE}}/cmake-${{matrix.CMAKE}}-windows-x86_64.zip
15+ NINJA_URL : https://github.com/ninja-build/ninja/releases/download/v${{matrix.NINJA}}/ninja-win.zip
16+
17+ steps :
18+ - name : Cache CMake
19+ uses : actions/cache@v3
20+ id : cmake
21+ env :
22+ cache-name : cache-cmake
23+ with :
24+ path : ~/Downloads/cmake-${{matrix.CMAKE}}-windows-x86_64.zip
25+ key : ${{ runner.os }}-${{ env.cache-name }}-${{matrix.CMAKE}}
26+ - name : Cache Ninja
27+ uses : actions/cache@v3
28+ id : ninja
29+ env :
30+ cache-name : cache-ninja
31+ with :
32+ path : ~/Downloads/ninja-win.zip
33+ key : ${{ runner.os }}-${{ env.cache-name }}-${{matrix.NINJA}}
34+ - name : Checkout CMake
35+ if : steps.cmake.outputs.cache-hit != 'true'
36+ shell : pwsh
37+ run : Invoke-WebRequest ${env:CMAKE_URL} -OutFile ~\Downloads\cmake-${{matrix.CMAKE}}-windows-x86_64.zip
38+ - name : Checkout Ninja
39+ if : steps.ninja.outputs.cache-hit != 'true'
40+ shell : pwsh
41+ run : Invoke-WebRequest ${env:NINJA_URL} -OutFile ~\Downloads\ninja-win.zip
42+
643 msvc :
44+ needs : [tools]
745 runs-on : windows-2022
846 strategy :
947 matrix :
@@ -13,11 +51,10 @@ jobs:
1351 BIN : [x64, x86]
1452 STD : [90, 11, 17]
1553 CMAKE : [3.22.0]
54+ NINJA : [1.10.2]
1655 env :
17- CMAKE_URL : https://github.com/Kitware/CMake/releases/download/v${{matrix.CMAKE}}/cmake-${{matrix.CMAKE}}-windows-x86_64.zip
1856 CMAKE_EXE : C:\Tools\Kitware\CMake\${{matrix.CMAKE}}\bin\cmake.exe
1957 CTEST_EXE : C:\Tools\Kitware\CMake\${{matrix.CMAKE}}\bin\ctest.exe
20- NINJA_URL : https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip
2158 NINJA_EXE : C:\Tools\Ninja\ninja.exe
2259
2360 steps :
@@ -30,15 +67,30 @@ jobs:
3067 repository : KhronosGroup/OpenCL-Headers
3168 path : external/OpenCL-Headers
3269
70+ - name : Restore CMake
71+ uses : actions/cache@v3
72+ id : cmake
73+ env :
74+ cache-name : cache-cmake
75+ with :
76+ path : ~/Downloads/cmake-${{matrix.CMAKE}}-windows-x86_64.zip
77+ key : ${{ runner.os }}-${{ env.cache-name }}-${{matrix.CMAKE}}
78+
79+ - name : Restore Ninja
80+ uses : actions/cache@v3
81+ id : ninja
82+ env :
83+ cache-name : cache-ninja
84+ with :
85+ path : ~/Downloads/ninja-win.zip
86+ key : ${{ runner.os }}-${{ env.cache-name }}-${{matrix.NINJA}}
87+
3388 - name : Create Build Environment
3489 shell : pwsh
3590 run : |
36- Invoke-WebRequest ${env:CMAKE_URL} -OutFile ~\Downloads\cmake-${{matrix.CMAKE}}-windows-x86_64.zip
3791 Expand-Archive ~\Downloads\cmake-${{matrix.CMAKE}}-windows-x86_64.zip -DestinationPath C:\Tools\Kitware\CMake\
3892 Rename-Item C:\Tools\Kitware\CMake\* ${{matrix.CMAKE}}
39- Invoke-WebRequest ${env:NINJA_URL} -OutFile ~\Downloads\ninja-win.zip
4093 Expand-Archive ~\Downloads\ninja-win.zip -DestinationPath C:\Tools\Ninja\
41- Remove-Item ~\Downloads\*
4294 & ${env:CMAKE_EXE} --version
4395 & ${env:NINJA_EXE} --version
4496
0 commit comments