Skip to content

Commit faf1ac5

Browse files
committed
ci: add glslc to PATH after Vulkan SDK install
1 parent a112d95 commit faf1ac5

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,24 @@ jobs:
7979
vulkan-query-version: latest
8080
vulkan-components: Vulkan-Headers,Vulkan-Loader
8181
vulkan-use-cache: true
82+
- name: Add glslc to PATH (Linux)
83+
if: runner.os == 'Linux'
84+
shell: bash
85+
run: |
86+
# The action extracts SDK under the workspace; search for glslc.
87+
GLSC=$(find "${{ github.workspace }}" -name "glslc" -type f 2>/dev/null | head -1)
88+
if [ -z "$GLSC" ]; then
89+
GLSC=$(find /usr/local -name "glslc" -type f 2>/dev/null | head -1)
90+
fi
91+
if [ -n "$GLSC" ]; then
92+
BIN_DIR=$(dirname "$GLSC")
93+
echo "$BIN_DIR" >> "$GITHUB_PATH"
94+
echo "Added $BIN_DIR to PATH (glslc=$GLSC)"
95+
else
96+
echo "::error::glslc not found after Vulkan SDK install"
97+
exit 1
98+
fi
99+
which glslc && glslc --version
82100
83101
- name: Install Vulkan SDK (Windows only)
84102
if: runner.os == 'Windows'
@@ -87,6 +105,27 @@ jobs:
87105
vulkan-query-version: latest
88106
vulkan-components: Vulkan-Headers,Vulkan-Loader
89107
vulkan-use-cache: true
108+
- name: Add glslc to PATH (Windows)
109+
if: runner.os == 'Windows'
110+
shell: pwsh
111+
run: |
112+
$glslc = Get-Command glslc -ErrorAction SilentlyContinue
113+
if (-not $glslc) {
114+
# Search common locations
115+
$dirs = @(
116+
Join-Path $env:VULKAN_SDK 'Bin',
117+
'C:\VulkanSDK\Bin',
118+
'C:\Program Files\VulkanSDK\Bin'
119+
)
120+
foreach ($d in $dirs) {
121+
if (Test-Path (Join-Path $d 'glslc.exe')) {
122+
$env:PATH = "$d;$env:PATH"
123+
Write-Host "Added $d to PATH"
124+
break
125+
}
126+
}
127+
}
128+
Get-Command glslc | Select-Object Source
90129
91130
- name: Cache CMake FetchContent
92131
uses: actions/cache@v4

0 commit comments

Comments
 (0)