Skip to content

Commit 682e879

Browse files
authored
Merge pull request #255 from gpx1000/fix-ci
Fix the CI to handle new Vulkan SDK versions
2 parents 407ed51 + ff14063 commit 682e879

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

.github/workflows/workflow.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ jobs:
9797
9898
tar -xJf vulkansdk-linux-x86_64-$VULKAN_VERSION.tar.xz
9999
100-
echo "VULKAN_SDK=$PWD/$VULKAN_VERSION/x86_64" >> $GITHUB_ENV
101-
echo "PATH=$PWD/$VULKAN_VERSION/x86_64/bin:$PATH" >> $GITHUB_ENV
102-
echo "LD_LIBRARY_PATH=$PWD/$VULKAN_VERSION/x86_64/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
103-
echo "VK_LAYER_PATH=$PWD/$VULKAN_VERSION/x86_64/etc/vulkan/explicit_layer.d" >> $GITHUB_ENV
100+
# Create/refresh a stable symlink to the latest SDK to avoid version-pinned paths in caches
101+
ln -sfn "$PWD/$VULKAN_VERSION" "$PWD/latest"
102+
103+
echo "VULKAN_SDK=$PWD/latest/x86_64" >> $GITHUB_ENV
104+
echo "PATH=$PWD/latest/x86_64/bin:$PATH" >> $GITHUB_ENV
105+
echo "LD_LIBRARY_PATH=$PWD/latest/x86_64/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
106+
echo "VK_LAYER_PATH=$PWD/latest/x86_64/etc/vulkan/explicit_layer.d" >> $GITHUB_ENV
104107
105108
cd ..
106109
deps-install: |
@@ -154,7 +157,14 @@ jobs:
154157
155158
$vulkanPath = ""
156159
if (Test-Path "C:\VulkanSDK") {
157-
$vulkanPath = Get-ChildItem "C:\VulkanSDK" | Sort-Object -Property Name -Descending | Select-Object -First 1 -ExpandProperty FullName
160+
# Prefer the 'Latest' junction if present, else pick the highest version folder
161+
if (Test-Path "C:\VulkanSDK\Latest") {
162+
$vulkanPath = "C:\VulkanSDK\Latest"
163+
} elseif (Test-Path "C:\VulkanSDK\latest") {
164+
$vulkanPath = "C:\VulkanSDK\latest"
165+
} else {
166+
$vulkanPath = Get-ChildItem "C:\VulkanSDK" | Where-Object { $_.PSIsContainer } | Sort-Object -Property Name -Descending | Select-Object -First 1 -ExpandProperty FullName
167+
}
158168
}
159169
if (-not $vulkanPath) {
160170
if (Test-Path "C:\VulkanSDK\latest") {
@@ -356,24 +366,20 @@ jobs:
356366
357367
- name: Cache build artifacts (Windows)
358368
if: runner.os == 'Windows'
359-
uses: actions/cache@v3
360-
with:
361-
path: |
362-
${{github.workspace}}/attachments/build
363-
key: ${{ runner.os }}-build-msvc-${{ hashFiles('**/CMakeLists.txt', 'scripts/install_dependencies_windows.bat') }}-${{ hashFiles('**/*.cpp', '**/*.h', '**/*.hpp') }}
364-
restore-keys: |
365-
${{ runner.os }}-build-msvc-${{ hashFiles('**/CMakeLists.txt', 'scripts/install_dependencies_windows.bat') }}-
366-
${{ runner.os }}-build-msvc-${{ hashFiles('**/CMakeLists.txt') }}-
367-
${{ runner.os }}-build-msvc-
369+
run: echo "Skipping build directory caching to avoid stale SDK paths"
368370

369371
- name: Configure CMake with MSVC (Windows)
370372
working-directory: ${{github.workspace}}/attachments
371373
if: runner.os == 'Windows'
372374
run: |
375+
# Ensure we always start from a clean configure to avoid stale paths
376+
if (Test-Path "build") { Remove-Item -Recurse -Force "build" }
377+
373378
cmake -B build -DCMAKE_BUILD_TYPE=Release `
374379
-DVulkan_INCLUDE_DIR="$env:Vulkan_INCLUDE_DIR" `
375380
-DVulkan_LIBRARY="$env:Vulkan_LIBRARY" `
376381
-DCMAKE_PREFIX_PATH="$env:VULKAN_SDK" `
382+
-DCMAKE_PROGRAM_PATH="$env:VULKAN_SDK\Bin" `
377383
-DCMAKE_TOOLCHAIN_FILE="$env:CMAKE_TOOLCHAIN_FILE" `
378384
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
379385
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
@@ -398,13 +404,7 @@ jobs:
398404
399405
- name: Cache build artifacts (Ubuntu)
400406
if: runner.os == 'Linux'
401-
uses: actions/cache@v3
402-
with:
403-
path: ${{github.workspace}}/attachments/build
404-
key: ${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp') }}-${{ hashFiles('**/*.h') }}
405-
restore-keys: |
406-
${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt') }}-
407-
${{ runner.os }}-build-
407+
run: echo "Skipping build directory caching to avoid stale SDK paths"
408408

409409
- name: Configure CMake (Unix)
410410
working-directory: ${{github.workspace}}/attachments
@@ -413,6 +413,9 @@ jobs:
413413
export CC="clang"
414414
export CXX="clang++"
415415
416+
# Ensure we always start from a clean configure to avoid stale paths
417+
rm -rf build
418+
416419
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
417420
-DCMAKE_CXX_SCAN_FOR_MODULES=ON \
418421
-DCMAKE_CXX_FLAGS="-std=c++20" \

0 commit comments

Comments
 (0)