Skip to content

Commit ab017c8

Browse files
committed
Update dependency caching.
1 parent 562138e commit ab017c8

4 files changed

Lines changed: 256 additions & 125 deletions

File tree

.github/workflows/ci.yml

Lines changed: 71 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ on:
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

.github/workflows/release.yml

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,49 @@ on:
1717
description: 'Location of the Release Log file.'
1818
required: true
1919

20-
env:
21-
vulkanSdkVersion: '1.4.328.1'
22-
llvmVersion: '20.1.8'
23-
2420
jobs:
21+
# ------------------------------------- Toolchain setup -------------------------------------
22+
setup:
23+
name: run-setup
24+
runs-on: ${{ matrix.os }}
25+
timeout-minutes: 10
26+
strategy:
27+
fail-fast: true
28+
matrix:
29+
name: [ windows-latest ]
30+
include:
31+
- name: windows-latest
32+
os: windows-latest
33+
#- name: ubuntu-latest
34+
# os: ubuntu-latest
35+
36+
env:
37+
MESA_3D_VERSION: ${{ vars.MESA_3D_VERSION }}
38+
VULKAN_SDK_VERSION: ${{ vars.VULKAN_SDK_VERSION }}
39+
CACHE_KEY: windows-dependencies-mesa-${{ vars.MESA_3D_VERSION }}-vulkan-${{ vars.VULKAN_SDK_VERSION }}
40+
41+
steps:
42+
- name: Setup dependency directory
43+
run: echo "DEPENDENCY_DIR=$env:RUNNER_TEMP/dep/win" >> $env:GITHUB_ENV
44+
45+
- name: Lookup dependency cache (no restore use)
46+
id: cache
47+
uses: actions/cache/restore@v6
48+
with:
49+
path: ${{ env.DEPENDENCY_DIR }}
50+
key: ${{ env.CACHE_KEY }}
51+
lookup-only: true
52+
53+
- name: Ensure cache exists
54+
if: steps.cache.outputs.cache-hit != 'true'
55+
run: |
56+
echo "Cache is missing. Please run 'update_dependencies.yml' workflow first."
57+
exit 1
58+
59+
# ------------------------------------- Build job -------------------------------------
2560
build:
2661
name: Build ${{ matrix.profile }}
62+
needs: [ setup ]
2763
runs-on: windows-latest
2864
strategy:
2965
fail-fast: true
@@ -50,26 +86,32 @@ jobs:
5086
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}-rel
5187
VCPKG_FEATURE_FLAGS: 'manifests'
5288

89+
MESA_3D_VERSION: ${{ vars.MESA_3D_VERSION }}
90+
VULKAN_SDK_VERSION: ${{ vars.VULKAN_SDK_VERSION }}
91+
LLVM_VERSION: ${{ vars.LLVM_VERSION }}
92+
CACHE_KEY: windows-dependencies-mesa-${{ vars.MESA_3D_VERSION }}-vulkan-${{ vars.VULKAN_SDK_VERSION }}
93+
5394
steps:
54-
- name: Setup Vulkan SDK
55-
uses: jakoch/install-vulkan-sdk-action@v1
56-
with:
57-
vulkan_version: ${{ env.vulkanSdkVersion }}
58-
install_runtime: true
59-
cache: true
60-
stripdown: false
61-
95+
- name: Setup dependency directory
96+
run: echo "DEPENDENCY_DIR=$env:RUNNER_TEMP/dep/win" >> $env:GITHUB_ENV
97+
98+
- name: Restore dependency cache
99+
uses: actions/cache/restore@v6
100+
with:
101+
path: ${{ env.DEPENDENCY_DIR }}
102+
key: ${{ env.CACHE_KEY }}
103+
62104
- name: Setup build environment
63105
id: setup-environment
64106
run: |
65-
cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
66-
cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
107+
cp "${{ env.DEPENDENCY_DIR }}/vulkan/${{ env.VULKAN_SDK_VERSION }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
108+
cp "${{ env.DEPENDENCY_DIR }}/vulkan/${{ env.VULKAN_SDK_VERSION }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
67109
68110
- name: Update LLVM
69111
if: ${{ matrix.compiler == 'clang' }}
70112
uses: KyleMayes/install-llvm-action@v2.0.9
71113
with:
72-
version: ${{ env.llvmVersion }}
114+
version: ${{ env.LLVM_VERSION }}
73115

74116
- name: Checking out sources
75117
uses: actions/checkout@master
@@ -133,7 +175,7 @@ jobs:
133175
- name: Download windows-msvc-x86 artifacts...
134176
uses: actions/download-artifact@v4
135177
with:
136-
name: LiteFX_win_x64_msvc
178+
name: LiteFX_win_x86_msvc
137179
path: ${{ github.workspace }}/../.artifacts/msvc/x86/
138180

139181
- name: Download windows-clang-x64 artifacts...

0 commit comments

Comments
 (0)