Skip to content

Commit 99f2944

Browse files
committed
Switch Vulkan SDK to .tar.xz format and enhance CI workflows
- Update Vulkan SDK to use `.tar.xz` archive format for Linux, updating download and extraction steps. - Replace Chocolatey-based Vulkan installation on Windows with a direct download and silent installer for better control. - Add comprehensive validation of Vulkan SDK installation across platforms, including checks for critical directories and files.
1 parent ccc96cb commit 99f2944

File tree

1 file changed

+76
-8
lines changed

1 file changed

+76
-8
lines changed

.github/workflows/workflow.yml

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
cd vulkan-sdk
2525
2626
# Download the SDK
27-
curl -O "https://sdk.lunarg.com/sdk/download/$VULKAN_VERSION/linux/vulkansdk-linux-x86_64-$VULKAN_VERSION.tar.gz"
27+
curl -O "https://sdk.lunarg.com/sdk/download/$VULKAN_VERSION/linux/vulkansdk-linux-x86_64-$VULKAN_VERSION.tar.xz"
2828
29-
# Extract the SDK
30-
tar -xzf vulkansdk-linux-x86_64-$VULKAN_VERSION.tar.gz
29+
# Extract the SDK - use tar with J flag for xz compression
30+
tar -xJf vulkansdk-linux-x86_64-$VULKAN_VERSION.tar.xz
3131
3232
# Set up environment variables
3333
echo "VULKAN_SDK=$PWD/$VULKAN_VERSION/x86_64" >> $GITHUB_ENV
@@ -69,11 +69,53 @@ jobs:
6969
fi
7070
- os: windows-latest
7171
vulkan-install: |
72-
# Install Vulkan SDK using Chocolatey (pre-installed on GitHub runners)
73-
choco install vulkan-sdk -y
72+
# Get the latest Vulkan SDK version
73+
$vulkanVersion = (Invoke-WebRequest -Uri "https://vulkan.lunarg.com/sdk/latest/windows.txt" -UseBasicParsing).Content.Trim()
74+
echo "Using Vulkan SDK version: $vulkanVersion"
7475
75-
# Set environment variables
76-
$vulkanPath = "C:\VulkanSDK\latest"
76+
# Download the Vulkan SDK installer with progress
77+
echo "Downloading Vulkan SDK installer..."
78+
$downloadUrl = "https://sdk.lunarg.com/sdk/download/$vulkanVersion/windows/VulkanSDK-$vulkanVersion-Installer.exe"
79+
echo "Download URL: $downloadUrl"
80+
81+
# Create a WebClient to show download progress
82+
$webClient = New-Object System.Net.WebClient
83+
$webClient.DownloadFile($downloadUrl, "$env:TEMP\vulkan-sdk.exe")
84+
echo "Download completed to: $env:TEMP\vulkan-sdk.exe"
85+
86+
# Verify the installer exists
87+
if (Test-Path "$env:TEMP\vulkan-sdk.exe") {
88+
echo "Installer file exists and is ready"
89+
echo "File size: $((Get-Item "$env:TEMP\vulkan-sdk.exe").Length) bytes"
90+
} else {
91+
echo "Installer file does not exist! Download failed."
92+
exit 1
93+
}
94+
95+
# Run the installer with silent options
96+
$installArgs = "--accept-licenses --default-answer --confirm-command install"
97+
echo "Running installer with arguments: $installArgs"
98+
Start-Process -FilePath "$env:TEMP\vulkan-sdk.exe" -ArgumentList $installArgs -Wait -NoNewWindow
99+
echo "Installer process completed"
100+
101+
# Find the actual installed SDK version
102+
echo "Checking for installed SDK..."
103+
if (Test-Path "C:\VulkanSDK") {
104+
echo "VulkanSDK directory exists"
105+
Get-ChildItem "C:\VulkanSDK" | ForEach-Object { echo "Found: $($_.FullName)" }
106+
$vulkanPath = Get-ChildItem "C:\VulkanSDK" | Sort-Object -Property Name -Descending | Select-Object -First 1 -ExpandProperty FullName
107+
} else {
108+
echo "VulkanSDK directory does not exist!"
109+
}
110+
111+
if (-not $vulkanPath) {
112+
echo "Could not find specific version directory, using latest"
113+
$vulkanPath = "C:\VulkanSDK\latest"
114+
}
115+
116+
echo "Using Vulkan SDK path: $vulkanPath"
117+
118+
# Set environment variables with correct Windows-style paths
77119
echo "VULKAN_SDK=$vulkanPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
78120
echo "$vulkanPath\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
79121
echo "CMAKE_PREFIX_PATH=$vulkanPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
@@ -167,7 +209,33 @@ jobs:
167209
run: |
168210
if (Test-Path $env:VULKAN_SDK) {
169211
echo "Vulkan SDK found at: $env:VULKAN_SDK"
170-
echo "Vulkan SDK installation verified"
212+
213+
# Check for critical directories and files
214+
$criticalPaths = @(
215+
"$env:VULKAN_SDK\Include",
216+
"$env:VULKAN_SDK\Lib",
217+
"$env:VULKAN_SDK\Bin",
218+
"$env:VULKAN_SDK\Include\vulkan\vulkan.h",
219+
"$env:VULKAN_SDK\Lib\vulkan-1.lib",
220+
"$env:VULKAN_SDK\Bin\glslangValidator.exe"
221+
)
222+
223+
$allPathsExist = $true
224+
foreach ($path in $criticalPaths) {
225+
if (Test-Path $path) {
226+
echo "✓ Found: $path"
227+
} else {
228+
echo "✗ Missing: $path"
229+
$allPathsExist = $false
230+
}
231+
}
232+
233+
if ($allPathsExist) {
234+
echo "Vulkan SDK installation verified successfully"
235+
} else {
236+
echo "Vulkan SDK installation is incomplete!"
237+
exit 1
238+
}
171239
} else {
172240
echo "Vulkan SDK not found!"
173241
exit 1

0 commit comments

Comments
 (0)