@@ -239,6 +239,7 @@ jobs:
239
239
name : Windows
240
240
env :
241
241
VCPKG_PATH : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
242
+ VCPKG_PATH_BIN : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows/bin;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows/bin;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows/bin"
242
243
strategy :
243
244
matrix :
244
245
os : ['windows-2019', 'windows-2022']
@@ -247,6 +248,7 @@ jobs:
247
248
shared_library : ['ON', 'OFF']
248
249
level_zero_provider : ['ON']
249
250
cuda_provider : ['ON']
251
+ cmake_ver : ['default']
250
252
include :
251
253
- os : ' windows-2019'
252
254
# clang build fails on Windows 2022
@@ -256,19 +258,22 @@ jobs:
256
258
level_zero_provider : ' ON'
257
259
cuda_provider : ' ON'
258
260
toolset : " -T ClangCL"
261
+ cmake_ver : ' 3.14.0-win64-x64'
259
262
- os : ' windows-2022'
260
263
build_type : Release
261
264
compiler : {c: cl, cxx: cl}
262
265
shared_library : ' ON'
263
266
level_zero_provider : ' ON'
264
267
cuda_provider : ' ON'
265
268
umfd_lib : ' ON'
269
+ cmake_ver : ' 3.28.0-windows-x86_64'
266
270
- os : ' windows-2022'
267
271
build_type : Release
268
272
compiler : {c: cl, cxx: cl}
269
273
shared_library : ' ON'
270
274
level_zero_provider : ' OFF'
271
275
cuda_provider : ' OFF'
276
+ cmake_ver : ' default'
272
277
273
278
runs-on : ${{matrix.os}}
274
279
@@ -278,15 +283,39 @@ jobs:
278
283
with :
279
284
fetch-depth : 0
280
285
286
+ - name : Install cmake (non-default version)
287
+ if : matrix.cmake_ver != 'default'
288
+ run : |
289
+ $ErrorActionPreference = "Stop"
290
+ $cmakePath = "C:\Program Files\CMake"
291
+ if (Test-Path -Path $cmakePath) {
292
+ Write-Host "Removing existing CMake installation..."
293
+ Remove-Item -Recurse -Force -Path $cmakePath
294
+ }
295
+ $cmakeInstaller = "cmake-${{matrix.cmake_ver}}.msi"
296
+ $cmakeInstallerParts = $cmakeInstaller -split '-|\.'
297
+ $cmakeMajorMinorPatch = "$($cmakeInstallerParts[1]).$($cmakeInstallerParts[2]).$($cmakeInstallerParts[3])"
298
+ $cmakeUrl = "https://github.com/Kitware/CMake/releases/download/v$cmakeMajorMinorPatch/$cmakeInstaller"
299
+ Write-Host "Downloading CMake version ${{matrix.cmake_ver}}..."
300
+ Invoke-WebRequest -Uri $cmakeUrl -OutFile $cmakeInstaller -TimeoutSec 360
301
+ Write-Host "Installing CMake version ${{matrix.cmake_ver}}..."
302
+ Start-Process msiexec.exe -ArgumentList "/i $cmakeInstaller /quiet /norestart" -Wait
303
+ cmake --version
304
+
281
305
- name : Initialize vcpkg
282
306
uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
283
307
with :
284
308
vcpkgGitCommitId : ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
285
309
vcpkgDirectory : ${{env.BUILD_DIR}}/vcpkg
286
310
vcpkgJsonGlob : ' **/vcpkg.json'
287
311
312
+ # Install the dependencies and add the bin folders to the PATH for older
313
+ # versions of CMake to correctly locate the libraries
288
314
- name : Install dependencies
289
- run : vcpkg install --triplet x64-windows
315
+ run : |
316
+ vcpkg install --triplet x64-windows
317
+ $env:Path = "${{env.VCPKG_PATH_BIN}};$env:Path"
318
+ echo "PATH=$env:Path" >> $env:GITHUB_ENV
290
319
shell : pwsh # Specifies PowerShell as the shell for running the script.
291
320
292
321
- name : Get UMF version
@@ -318,10 +347,23 @@ jobs:
318
347
319
348
- name : Run tests
320
349
working-directory : ${{env.BUILD_DIR}}
321
- run : ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
350
+ # For CMake versions < 3.22 we have to add the build directory to the PATH
351
+ # manually
352
+ run : |
353
+ $m = [regex]::Matches((cmake --version), "cmake version (\d+)\.(\d+)\.(\d+)")
354
+ if ($m) {
355
+ $major = [int]$m.groups[1].Value
356
+ $minor = [int]$m.groups[2].Value
357
+ if ($major -lt 3 -or ($major -eq 3 -and $minor -lt 22)) {
358
+ $env:Path = "${{env.BUILD_DIR}}/bin/${{matrix.build_type}};${{env.BUILD_DIR}}/src/proxy_lib/${{matrix.build_type}};$env:Path"
359
+ }
360
+ }
361
+ ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
362
+ shell : pwsh
322
363
323
364
- name : Test UMF installation and uninstallation
324
- # The '--shared-library' parameter is added to the installation test when the UMF is built as a shared library
365
+ # The '--shared-library' parameter is added to the installation test when
366
+ # the UMF is built as a shared library
325
367
run : >
326
368
python3 ${{github.workspace}}/test/test_installation.py
327
369
--build-dir ${{env.BUILD_DIR}}
0 commit comments