2929 required : true
3030 default : ' checks' # Case sensitive. Must contain one or more of: 'checks', 'tests', 'tidy' or 'builds'.
3131
32- # Environment variables control which version of dependent software to install.
33- env :
34- vulkanSdkVersion : ' 1.4.328.1'
35- mesaDriverVersion : ' 24.1.1'
36- llvmVersion : ' 20.1.8'
37-
3832# The following jobs are contained in this workflow:
3933# - First, the `verify-permissions` job is executed. It checks if the comment user is a contributer or maintainer and if the comment refers to a pull request. It then parses the
4034# command string. If permission is granted, the result is then passed to the subsequent jobs, which only execute if this job outputs their respective launch command.
@@ -123,48 +117,29 @@ jobs:
123117 os : windows-latest
124118 # - name: ubuntu-latest
125119 # os: ubuntu-latest
126-
120+
121+ env :
122+ MESA_3D_VERSION : ${{ vars.MESA_3D_VERSION }}
123+ VULKAN_SDK_VERSION : ${{ vars.VULKAN_SDK_VERSION }}
124+ CACHE_KEY : windows-dependencies-mesa-${{ vars.MESA_3D_VERSION }}-vulkan-${{ vars.VULKAN_SDK_VERSION }}
125+
127126 steps :
128- - name : Setup Vulkan SDK
129- uses : jakoch/install-vulkan-sdk-action@v1
130- with :
131- vulkan_version : ${{ env.vulkanSdkVersion }}
132- install_runtime : true
133- cache : true
134- stripdown : true
135-
136- - name : Lookup Mesa3D cache
137- uses : actions/cache@v4
138- id : lookup-mesa
127+ - name : Setup dependency directory
128+ run : echo "DEPENDENCY_DIR=$env:RUNNER_TEMP/dep/win" >> $env:GITHUB_ENV
129+
130+ - name : Lookup dependency cache (no restore use)
131+ id : cache
132+ uses : actions/cache/restore@v6
139133 with :
140- key : ${{ matrix.os }}-mesa3d-${{ env.mesaDriverVersion }}
141- path : ${{ github.workspace }}/dep/mesa/
134+ path : ${{ env.DEPENDENCY_DIR }}
135+ key : ${{ env.CACHE_KEY }}
142136 lookup-only : true
143137
144- - name : Download Mesa3D driver
145- uses : robinraju/release-downloader@v1.10
146- if : steps.lookup-mesa.outputs.cache-hit != 'true'
147- with :
148- repository : ' pal1000/mesa-dist-win'
149- tag : ' ${{ env.mesaDriverVersion }}'
150- fileName : ' mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
151- out-file-path : ' dep/mesa/' # ${{ github.workspace }} is prefixed automatically.
152- extract : false # 7zip is not supported by this extension, so we have to do it on our own later.
153-
154- - name : Decompress Mesa3D driver
155- working-directory : ' ${{ github.workspace }}/dep/mesa/'
156- if : steps.lookup-mesa.outputs.cache-hit != 'true'
157- shell : bash
138+ - name : Ensure cache exists
139+ if : steps.cache.outputs.cache-hit != 'true'
158140 run : |
159- 7z x '${{ github.workspace }}/dep/mesa/mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
160- rm '${{ github.workspace }}/dep/mesa/mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
161-
162- - name : Cache Mesa3D
163- uses : actions/cache/save@v4
164- if : steps.lookup-mesa.outputs.cache-hit != 'true'
165- with :
166- path : ${{ github.workspace }}/dep/mesa/
167- key : ${{ matrix.os }}-mesa3d-${{ env.mesaDriverVersion }}
141+ echo "Cache is missing. Please run 'update_dependencies.yml' workflow first."
142+ exit 1
168143
169144 # ------------------------------------- Test job -------------------------------------
170145 test :
@@ -186,8 +161,17 @@ jobs:
186161 os : windows-latest
187162 compiler : clang
188163 configuration : windows-clang-x64-test
164+
165+ env :
166+ MESA_3D_VERSION : ${{ vars.MESA_3D_VERSION }}
167+ VULKAN_SDK_VERSION : ${{ vars.VULKAN_SDK_VERSION }}
168+ LLVM_VERSION : ${{ vars.LLVM_VERSION }}
169+ CACHE_KEY : windows-dependencies-mesa-${{ vars.MESA_3D_VERSION }}-vulkan-${{ vars.VULKAN_SDK_VERSION }}
189170
190171 steps :
172+ - name : Setup dependency directory
173+ run : echo "DEPENDENCY_DIR=$env:RUNNER_TEMP/dep/win" >> $env:GITHUB_ENV
174+
191175 - name : Retrieve PR info
192176 id : retrieve-pr-from-issue-comment
193177 uses : actions/github-script@v3
@@ -237,14 +221,7 @@ jobs:
237221 ref : ${{ env.HEAD_SHA }}
238222 submodules : true
239223
240- - name : Setup Vulkan SDK
241- uses : jakoch/install-vulkan-sdk-action@v1
242- with :
243- vulkan_version : ${{ env.vulkanSdkVersion }}
244- install_runtime : true
245- cache : true
246- stripdown : false
247-
224+ # TODO: Move this into cache as well.
248225 - name : Install OpenCppCoverage
249226 id : install-opencppcoverage
250227 shell : bash
@@ -256,34 +233,34 @@ jobs:
256233 if : ${{ matrix.compiler == 'clang' }}
257234 uses : KyleMayes/install-llvm-action@v2.0.9
258235 with :
259- version : ${{ env.llvmVersion }}
236+ version : ${{ env.LLVM_VERSION }}
237+
238+ - name : Restore dependency cache
239+ uses : actions/cache/restore@v6
240+ with :
241+ path : ${{ env.DEPENDENCY_DIR }}
242+ key : ${{ env.CACHE_KEY }}
260243
261244 - name : Setup build and test environment
262245 id : setup-environment
263246 shell : bash
264247 run : |
265248 echo "VCPKG_FEATURE_FLAGS=manifests" >> $env:GITHUB_ENV
266249 echo "C:\msys64\ucrt64\bin" >> $GITHUB_PATH
267- #echo "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
268- cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
269- cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
270-
271- - name : Restore Mesa3D
272- uses : actions/cache/restore@v4
273- with :
274- path : ${{ github.workspace }}/dep/mesa/
275- key : ${{ matrix.os }}-mesa3d-${{ env.mesaDriverVersion }}
250+ #echo "${{ env.DEPENDENCY_DIR }}/vulkan/${{ env.VULKAN_SDK_VERSION }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
251+ cp "${{ env.DEPENDENCY_DIR }}/vulkan/${{ env.VULKAN_SDK_VERSION }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
252+ cp "${{ env.DEPENDENCY_DIR }}/vulkan/${{ env.VULKAN_SDK_VERSION }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
276253
277254 - name : Install and Test Mesa3D driver
278255 working-directory : ' ${{ github.workspace }}/dep/mesa/'
279256 run : |
280- reg add "HKLM\SOFTWARE\Khronos\Vulkan\Drivers" /v '${{ github.workspace }}\dep \mesa\x64\lvp_icd.x86_64.json' /t REG_DWORD /d 0 /f /reg:64
281- reg add "HKLM\SOFTWARE\Khronos\Vulkan\ExplicitLayers" /v 'C:\VulkanSDK \${{ env.vulkanSdkVersion }}\Bin\VkLayer_khronos_synchronization2.json' /t REG_DWORD /d 0 /f /reg:64
282- reg add "HKLM\SOFTWARE\Khronos\Vulkan\ExplicitLayers" /v 'C:\VulkanSDK \${{ env.vulkanSdkVersion }}\Bin\VkLayer_khronos_validation.json' /t REG_DWORD /d 0 /f /reg:64
283- reg add "HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\Drivers" /v '${{ github.workspace }}\dep \mesa\x86\lvp_icd.x86.json' /t REG_DWORD /d 0 /f /reg:64
284- reg add "HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers" /v 'C:\VulkanSDK \${{ env.vulkanSdkVersion }}\Bin32\VkLayer_khronos_synchronization2.json' /t REG_DWORD /d 0 /f /reg:64
285- reg add "HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers" /v 'C:\VulkanSDK \${{ env.vulkanSdkVersion }}\Bin32\VkLayer_khronos_validation.json' /t REG_DWORD /d 0 /f /reg:64
286- C:\VulkanSDK \${{ env.vulkanSdkVersion }}\runtime\x64\vulkaninfo.exe --summary
257+ reg add "HKLM\SOFTWARE\Khronos\Vulkan\Drivers" /v '${{ env.DEPENDENCY_DIR }}\mesa\x64\lvp_icd.x86_64.json' /t REG_DWORD /d 0 /f /reg:64
258+ reg add "HKLM\SOFTWARE\Khronos\Vulkan\ExplicitLayers" /v '${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\Bin\VkLayer_khronos_synchronization2.json' /t REG_DWORD /d 0 /f /reg:64
259+ reg add "HKLM\SOFTWARE\Khronos\Vulkan\ExplicitLayers" /v '${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\Bin\VkLayer_khronos_validation.json' /t REG_DWORD /d 0 /f /reg:64
260+ reg add "HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\Drivers" /v '${{ env.DEPENDENCY_DIR }}\mesa\x86\lvp_icd.x86.json' /t REG_DWORD /d 0 /f /reg:64
261+ reg add "HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers" /v '${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\Bin32\VkLayer_khronos_synchronization2.json' /t REG_DWORD /d 0 /f /reg:64
262+ reg add "HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers" /v '${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\Bin32\VkLayer_khronos_validation.json' /t REG_DWORD /d 0 /f /reg:64
263+ ${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\runtime\x64\vulkaninfo.exe --summary
287264
288265 - name : Restore or build vcpkg
289266 uses : lukka/run-vcpkg@v10
@@ -426,29 +403,27 @@ jobs:
426403 with :
427404 ref : ${{ env.HEAD_SHA }}
428405 submodules : true
429-
430- - name : Setup Vulkan SDK
431- uses : jakoch/install-vulkan-sdk-action@v1
432- with :
433- vulkan_version : ${{ env.vulkanSdkVersion }}
434- install_runtime : true
435- cache : true
436- stripdown : false
437406
438407 - name : Update LLVM
439408 if : ${{ matrix.compiler == 'clang' }}
440409 uses : KyleMayes/install-llvm-action@v2.0.9
441410 with :
442- version : ${{ env.llvmVersion }}
411+ version : ${{ env.LLVM_VERSION }}
443412
413+ - name : Restore dependency cache
414+ uses : actions/cache/restore@v6
415+ with :
416+ path : ${{ env.DEPENDENCY_DIR }}
417+ key : ${{ env.CACHE_KEY }}
418+
444419 - name : Setup build and test environment
445420 id : setup-environment
446421 shell : bash
447422 run : |
448423 echo "VCPKG_FEATURE_FLAGS=manifests" >> $env:GITHUB_ENV
449- #echo "C:\VulkanSDK \${{ env.vulkanSdkVersion }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
450- cp "C:\VulkanSDK \${{ env.vulkanSdkVersion }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
451- cp "C:\VulkanSDK \${{ env.vulkanSdkVersion }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
424+ #echo "${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
425+ cp "${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
426+ cp "${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
452427 echo "C:\msys64\ucrt64\bin" >> $GITHUB_PATH
453428
454429 - name : Retrieve latest CMake build
@@ -531,12 +506,17 @@ jobs:
531506 compiler : clang
532507 triplet : x64-windows
533508 configuration : windows-clang-x64-release-static
534-
509+
535510 env :
536- VCPKG_DEFAULT_TRIPLET : ${{ matrix.triplet }}-rel
537- VCPKG_FEATURE_FLAGS : ' manifests'
511+ MESA_3D_VERSION : ${{ vars.MESA_3D_VERSION }}
512+ VULKAN_SDK_VERSION : ${{ vars.VULKAN_SDK_VERSION }}
513+ LLVM_VERSION : ${{ vars.LLVM_VERSION }}
514+ CACHE_KEY : windows-dependencies-mesa-${{ vars.MESA_3D_VERSION }}-vulkan-${{ vars.VULKAN_SDK_VERSION }}
538515
539516 steps :
517+ - name : Setup dependency directory
518+ run : echo "DEPENDENCY_DIR=$env:RUNNER_TEMP/dep/win" >> $env:GITHUB_ENV
519+
540520 - name : Retrieve PR info
541521 id : retrieve-pr-from-issue-comment
542522 uses : actions/github-script@v3
@@ -580,27 +560,25 @@ jobs:
580560 sha : ${{ env.HEAD_SHA }}
581561 status : in_progress
582562
583- - name : Setup Vulkan SDK
584- uses : jakoch/install-vulkan-sdk-action@v1
563+ - name : Restore dependency cache
564+ uses : actions/cache/restore@v6
585565 with :
586- vulkan_version : ${{ env.vulkanSdkVersion }}
587- install_runtime : true
588- cache : true
589- stripdown : false
566+ path : ${{ env.DEPENDENCY_DIR }}
567+ key : ${{ env.CACHE_KEY }}
590568
591569 - name : Setup build and test environment
592570 id : setup-environment
593571 shell : bash
594572 run : |
595- #echo "C:\VulkanSDK \${{ env.vulkanSdkVersion }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
596- cp "C:\VulkanSDK \${{ env.vulkanSdkVersion }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
597- cp "C:\VulkanSDK \${{ env.vulkanSdkVersion }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
573+ #echo "${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
574+ cp "${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
575+ cp "${{ env.DEPENDENCY_DIR }}\vulkan \${{ env.VULKAN_SDK_VERSION }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
598576
599577 - name : Update LLVM
600578 if : ${{ matrix.compiler == 'clang' }}
601579 uses : KyleMayes/install-llvm-action@v2.0.9
602580 with :
603- version : ${{ env.llvmVersion }}
581+ version : ${{ env.LLVM_VERSION }}
604582
605583 - name : Checking out sources
606584 uses : actions/checkout@master
0 commit comments