@@ -60,22 +60,33 @@ jobs:
6060 - os : windows-latest
6161 ccache : sccache
6262 vulkan-install : |
63+ # Download the Vulkan SDK installer
6364 Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe" -OutFile "$env:TEMP\vulkan-sdk.exe"
6465
65- Start-Process -FilePath "$env:TEMP\vulkan-sdk.exe" -ArgumentList "--accept-licenses --default-answer --confirm-command install" -Wait -NoNewWindow
66+ # Install only the necessary components of Vulkan SDK
67+ # --components argument specifies only the components we need:
68+ # - VulkanRT: Vulkan Runtime
69+ # - VulkanSDK32: Core 32-bit SDK
70+ # - VulkanSDK64: Core 64-bit SDK
71+ # - VulkanDXC: DirectX Shader Compiler
72+ # - VulkanTools: Vulkan Tools (includes glslangValidator)
73+ Start-Process -FilePath "$env:TEMP\vulkan-sdk.exe" -ArgumentList "--accept-licenses --default-answer --confirm-command install --components VulkanRT,VulkanSDK64,VulkanDXC,VulkanTools" -Wait -NoNewWindow
6674
75+ # Find the installed Vulkan SDK path
6776 $vulkanPath = Get-ChildItem "C:\VulkanSDK" | Sort-Object -Property Name -Descending | Select-Object -First 1 -ExpandProperty FullName
6877
6978 if (-not $vulkanPath) {
7079 $vulkanPath = "C:\VulkanSDK\latest"
7180 }
7281
82+ # Set environment variables
7383 echo "VULKAN_SDK=$vulkanPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
7484 echo "$vulkanPath\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7585 echo "CMAKE_PREFIX_PATH=$vulkanPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
7686 echo "Vulkan_INCLUDE_DIR=$vulkanPath\Include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
7787 echo "Vulkan_LIBRARY=$vulkanPath\Lib\vulkan-1.lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
7888
89+ # Verify installation
7990 Write-Host "Vulkan SDK path: $vulkanPath"
8091 if (Test-Path "$vulkanPath\Lib") {
8192 Write-Host "Lib directory exists"
@@ -125,18 +136,21 @@ jobs:
125136 ${{ env.VCPKG_INSTALLATION_ROOT }}/installed
126137 ${{ env.VCPKG_INSTALLATION_ROOT }}/packages
127138 ${{ env.VCPKG_INSTALLATION_ROOT }}/buildtrees
128- key : ${{ runner.os }}-vcpkg-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp') }}
139+ ${{ env.VCPKG_INSTALLATION_ROOT }}/downloads
140+ key : ${{ runner.os }}-vcpkg-${{ hashFiles('scripts/install_dependencies_windows.bat', '**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp', '**/*.h') }}
129141 restore-keys : |
130- ${{ runner.os }}-vcpkg-${{ hashFiles('**/CMakeLists.txt') }}-
142+ ${{ runner.os }}-vcpkg-${{ hashFiles('scripts/install_dependencies_windows.bat', '**/CMakeLists.txt') }}-
143+ ${{ runner.os }}-vcpkg-${{ hashFiles('scripts/install_dependencies_windows.bat') }}-
131144 ${{ runner.os }}-vcpkg-
132145
133146 - name : Cache Vulkan SDK (Windows)
134147 if : runner.os == 'Windows'
135148 uses : actions/cache@v3
136149 with :
137150 path : C:\VulkanSDK
138- key : ${{ runner.os }}-vulkan-sdk-${{ hashFiles('**/CMakeLists.txt') }}
151+ key : ${{ runner.os }}-vulkan-sdk-${{ hashFiles('**/CMakeLists.txt', '**/*.cpp', '**/*.h' ) }}
139152 restore-keys : |
153+ ${{ runner.os }}-vulkan-sdk-${{ hashFiles('**/CMakeLists.txt') }}-
140154 ${{ runner.os }}-vulkan-sdk-
141155
142156 - name : Cache apt packages (Ubuntu)
@@ -169,25 +183,48 @@ jobs:
169183 ${{ runner.os }}-vulkan-sdk-${{ hashFiles('**/CMakeLists.txt') }}-
170184 ${{ runner.os }}-vulkan-sdk-
171185
172- - name : Install ccache (Ubuntu)
186+ - name : Install and configure ccache (Ubuntu)
173187 if : runner.os == 'Linux'
174188 run : |
175189 sudo apt-get update
176190 sudo apt-get install -y ccache
177- ccache --max-size=2G
191+
192+ # Configure ccache for optimal performance
193+ ccache --max-size=4G
194+ ccache --set-config=compression=true
195+ ccache --set-config=compression_level=9
196+ ccache --set-config=sloppiness=file_macro,time_macros,include_file_mtime,include_file_ctime
197+ ccache --set-config=hash_dir=false
178198 ccache -z
199+
179200 echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
180201 echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
181202
182- - name : Install sccache (Windows)
203+ # Set environment variables for better ccache performance
204+ echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
205+ echo "CCACHE_COMPRESSLEVEL=9" >> $GITHUB_ENV
206+ echo "CCACHE_MAXSIZE=4G" >> $GITHUB_ENV
207+
208+ - name : Install and configure sccache (Windows)
183209 if : runner.os == 'Windows'
184210 run : |
211+ # Download and extract sccache
185212 Invoke-WebRequest -Uri "https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-x86_64-pc-windows-msvc.tar.gz" -OutFile "sccache.tar.gz"
186213 tar -xzf sccache.tar.gz
187214 $sccachePath = Join-Path -Path (Get-Location) -ChildPath "sccache-v0.5.4-x86_64-pc-windows-msvc"
188215 echo "$sccachePath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
216+
217+ # Configure sccache for optimal performance
189218 echo "SCCACHE_DIR=$HOME/.cache/sccache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
190- echo "SCCACHE_CACHE_SIZE=2G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
219+ echo "SCCACHE_CACHE_SIZE=4G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
220+ echo "SCCACHE_ERROR_LOG=$HOME/.cache/sccache/sccache.log" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
221+ echo "SCCACHE_LOG=info" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
222+
223+ # Create cache directory if it doesn't exist
224+ New-Item -ItemType Directory -Force -Path "$HOME/.cache/sccache"
225+
226+ # Set environment variables for better sccache performance
227+ echo "RUST_LOG=sccache=info" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
191228
192229 - name : Install dependencies
193230 run : ${{ matrix.deps-install }}
@@ -235,23 +272,39 @@ jobs:
235272 if : runner.os == 'Windows'
236273 uses : actions/cache@v3
237274 with :
238- path : ${{github.workspace}}/attachments/build
239- key : ${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp') }}-${{ hashFiles('**/*.h') }}
275+ path : |
276+ ${{github.workspace}}/attachments/build
277+ ${{github.workspace}}/attachments/build/.ninja_deps
278+ ${{github.workspace}}/attachments/build/.ninja_log
279+ key : ${{ runner.os }}-build-ninja-${{ hashFiles('**/CMakeLists.txt', 'scripts/install_dependencies_windows.bat') }}-${{ hashFiles('**/*.cpp', '**/*.h', '**/*.hpp') }}
240280 restore-keys : |
241- ${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt') }}-
242- ${{ runner.os }}-build-
281+ ${{ runner.os }}-build-ninja-${{ hashFiles('**/CMakeLists.txt', 'scripts/install_dependencies_windows.bat') }}-
282+ ${{ runner.os }}-build-ninja-${{ hashFiles('**/CMakeLists.txt') }}-
283+ ${{ runner.os }}-build-ninja-
243284
244- - name : Configure CMake (Windows)
285+ - name : Install Ninja (Windows)
286+ if : runner.os == 'Windows'
287+ run : |
288+ # Install Ninja build system for faster builds
289+ choco install ninja -y
290+ # Verify installation
291+ ninja --version
292+
293+ - name : Configure CMake with Ninja (Windows)
245294 working-directory : ${{github.workspace}}/attachments
246295 if : runner.os == 'Windows'
247296 run : |
248- cmake -B build -DCMAKE_BUILD_TYPE=Release `
297+ # Configure CMake with Ninja generator for faster builds
298+ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release `
249299 -DVulkan_INCLUDE_DIR="$env:Vulkan_INCLUDE_DIR" `
250300 -DVulkan_LIBRARY="$env:Vulkan_LIBRARY" `
251301 -DCMAKE_PREFIX_PATH="$env:VULKAN_SDK" `
252302 -DCMAKE_TOOLCHAIN_FILE="$env:CMAKE_TOOLCHAIN_FILE" `
253303 -DCMAKE_C_COMPILER_LAUNCHER=sccache `
254- -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
304+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
305+ -DCMAKE_CXX_FLAGS="/MP /EHsc /Zi /W3" `
306+ -DCMAKE_SHARED_LINKER_FLAGS="/DEBUG:FASTLINK" `
307+ -DCMAKE_EXE_LINKER_FLAGS="/DEBUG:FASTLINK"
255308
256309 if (Test-Path "build/CMakeCache.txt") {
257310 Write-Host "CMake cache contents:"
@@ -273,11 +326,15 @@ jobs:
273326 if : runner.os == 'Linux'
274327 uses : actions/cache@v3
275328 with :
276- path : ${{github.workspace}}/attachments/build
277- key : ${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp') }}-${{ hashFiles('**/*.h') }}
329+ path : |
330+ ${{github.workspace}}/attachments/build
331+ ${{github.workspace}}/attachments/build/.ninja_deps
332+ ${{github.workspace}}/attachments/build/.ninja_log
333+ key : ${{ runner.os }}-build-ninja-${{ hashFiles('**/CMakeLists.txt', 'scripts/install_dependencies_linux.sh') }}-${{ hashFiles('**/*.cpp', '**/*.h', '**/*.hpp') }}
278334 restore-keys : |
279- ${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt') }}-
280- ${{ runner.os }}-build-
335+ ${{ runner.os }}-build-ninja-${{ hashFiles('**/CMakeLists.txt', 'scripts/install_dependencies_linux.sh') }}-
336+ ${{ runner.os }}-build-ninja-${{ hashFiles('**/CMakeLists.txt') }}-
337+ ${{ runner.os }}-build-ninja-
281338
282339 - name : Configure CMake (Unix)
283340 working-directory : ${{github.workspace}}/attachments
@@ -292,9 +349,9 @@ jobs:
292349 -DCMAKE_C_COMPILER_LAUNCHER=ccache \
293350 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
294351
295- - name : Build
352+ - name : Build with parallel jobs
296353 working-directory : ${{github.workspace}}/attachments
297- run : cmake --build build --config Release
354+ run : cmake --build build --config Release --parallel 4
298355
299356 - name : ccache statistics
300357 if : runner.os == 'Linux'
@@ -469,7 +526,6 @@ jobs:
469526 echo "org.gradle.parallel=true" >> gradle.properties
470527 echo "org.gradle.caching=true" >> gradle.properties
471528 echo "org.gradle.configureondemand=true" >> gradle.properties
472- echo "android.enableBuildCache=true" >> gradle.properties
473529 echo "kotlin.incremental=true" >> gradle.properties
474530
475531 # Create directory for build outputs
0 commit comments