-
Notifications
You must be signed in to change notification settings - Fork 44
586 lines (526 loc) · 23 KB
/
reusable_basic.yml
File metadata and controls
586 lines (526 loc) · 23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# Builds project (with various compilers, CMake options, etc.) and runs tests
name: BasicBuilds
on: workflow_call
permissions:
contents: read
packages: read
env:
BUILD_DIR : "${{github.workspace}}/build"
INSTL_DIR : "${{github.workspace}}/install-dir"
COVERAGE_DIR : "${{github.workspace}}/coverage"
COVERAGE_NAME : "exports-coverage-basic"
jobs:
ubuntu-build:
runs-on: ubuntu-latest
container:
image: ghcr.io/bb-ur/umf-${{ matrix.os }}:latest
options: --user test_user --cap-add=SYS_NICE --cap-add=SYS_PTRACE
volumes:
- ${{ github.workspace }}:${{ github.workspace }}
strategy:
matrix:
os: ['ubuntu-22.04', 'ubuntu-24.04']
build_type: [Debug, Release]
compiler: [{c: gcc, cxx: g++}]
shared_library: ['OFF']
level_zero_provider: ['ON']
cuda_provider: ['ON']
install_tbb: ['ON']
link_hwloc_statically: ['OFF']
cmake_ver: ['default']
include:
- os: ubuntu-22.04
build_type: Release
compiler: {c: clang, cxx: clang++}
shared_library: 'OFF'
level_zero_provider: 'ON'
cuda_provider: 'ON'
install_tbb: 'ON'
link_hwloc_statically: 'OFF'
# check minimum supported cmake version
cmake_ver: '3.14.0'
- os: ubuntu-22.04
build_type: Release
compiler: {c: gcc, cxx: g++}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
install_tbb: 'ON'
link_hwloc_statically: 'OFF'
cmake_ver: '3.28.0'
- os: ubuntu-24.04
build_type: Debug
compiler: {c: gcc, cxx: g++}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
install_tbb: 'ON'
link_hwloc_statically: 'OFF'
cmake_ver: 'default'
# test level_zero_provider='OFF' and cuda_provider='OFF'
- os: ubuntu-22.04
build_type: Release
compiler: {c: gcc, cxx: g++}
shared_library: 'OFF'
level_zero_provider: 'OFF'
cuda_provider: 'OFF'
install_tbb: 'ON'
link_hwloc_statically: 'OFF'
cmake_ver: 'default'
# test icx compiler
- os: ubuntu-22.04
build_type: Release
compiler: {c: icx, cxx: icpx}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
install_tbb: 'ON'
link_hwloc_statically: 'OFF'
cmake_ver: 'default'
# test lld linker
- os: ubuntu-24.04
build_type: Release
compiler: {c: icx, cxx: icpx}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
install_tbb: 'ON'
link_hwloc_statically: 'OFF'
llvm_linker: '-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld"'
cmake_ver: 'default'
# test without installing TBB
- os: ubuntu-22.04
build_type: Release
compiler: {c: gcc, cxx: g++}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
install_tbb: 'OFF'
link_hwloc_statically: 'OFF'
cmake_ver: 'default'
- os: ubuntu-22.04
build_type: Release
compiler: {c: gcc, cxx: g++}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
install_tbb: 'ON'
link_hwloc_statically: 'ON'
cmake_ver: 'default'
name: Basic (${{matrix.os}}, build_type=${{matrix.build_type}}, compilers=${{matrix.compiler.c}}/${{matrix.compiler.cxx}}, shared_library=${{matrix.shared_library}}, level_zero_provider=${{matrix.level_zero_provider}}, cuda_provider=${{matrix.cuda_provider}}, install_tbb=${{matrix.install_tbb}}, link_hwloc_statically=${{matrix.link_hwloc_statically}}, cmake_ver=${{matrix.cmake_ver}})
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Install cmake (non-default version)
if: matrix.cmake_ver != 'default'
run: |
echo ${USERPASS} | sudo -Sk apt-get remove --purge -y cmake
wget https://github.com/Kitware/CMake/releases/download/v${{matrix.cmake_ver}}/cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
chmod +x cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
echo ${USERPASS} | sudo -Sk ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local
- name: Uninstall TBB apt package
if: matrix.install_tbb == 'OFF'
run: |
echo ${USERPASS} | sudo -Sk apt-get remove --purge -y '*tbb*'
echo ${USERPASS} | sudo -Sk apt-get autoremove -y
- name: Install oneAPI basekit
if: matrix.compiler.cxx == 'icpx'
run: |
echo "${USERPASS}" | sudo -Sk ./.github/scripts/install_oneAPI.sh
- name: Get UMF version
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
echo "UMF_VERSION=$VERSION" >> $GITHUB_ENV
- name: Configure build
run: >
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh &&' || ''}}
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}}
${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' && '-DUMF_USE_COVERAGE=ON' || '' }}
${{ matrix.llvm_linker || '' }}
- name: Build UMF
run: |
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
cmake --build ${{env.BUILD_DIR}} -j $(nproc)
- name: Run tests
working-directory: ${{env.BUILD_DIR}}
run: |
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
LD_LIBRARY_PATH="${{env.BUILD_DIR}}/lib/:${LD_LIBRARY_PATH}" ctest --output-on-failure
- name: Check coverage
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
working-directory: ${{env.BUILD_DIR}}
run: |
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
mkdir -p ${{env.COVERAGE_DIR}}
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
with:
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
path: ${{env.COVERAGE_DIR}}
- name: Remove the installation directory
run: rm -rf ${{env.INSTL_DIR}}
- name: Test UMF installation and uninstallation
run: >
python3 ${{github.workspace}}/test/test_installation.py
--build-dir ${{env.BUILD_DIR}}
--install-dir ${{env.INSTL_DIR}}
--build-type ${{matrix.build_type}}
${{ matrix.install_tbb == 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
--umf-version ${{env.UMF_VERSION}}
${{ matrix.shared_library == 'ON' && '--shared-library' || '' }}
windows-build:
env:
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows"
VCPKG_PATH_BIN: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows/bin;${{github.workspace}}/vcpkg/packages/tbb_x64-windows/bin;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows/bin"
strategy:
matrix:
os: ['windows-2022', 'windows-2025']
compiler: [{c: cl, cxx: cl}]
shared_library: ['ON', 'OFF']
level_zero_provider: ['ON']
cuda_provider: ['ON']
include:
# extra job: Custom (old) CMake, clang-cl compiler
# Note: This CMake uses NMake generator as VS paths are probably messed up (by CMake?)
- os: 'windows-2025'
extra_release_build_type: '-DCMAKE_BUILD_TYPE=Release' # NMake generator requires this
compiler: {c: clang-cl, cxx: clang-cl}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
cmake_ver: '3.14.0-win64-x64'
# extra job: Custom CMake, L0/CUDA providers disabled
- os: 'windows-2025'
compiler: {c: cl, cxx: cl}
shared_library: 'ON'
level_zero_provider: 'OFF'
cuda_provider: 'OFF'
cmake_ver: '3.28.0-windows-x86_64'
# umfd enabled (this job will replace one from matrix)
- os: 'windows-2022'
compiler: {c: cl, cxx: cl}
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
umfd_lib: 'ON'
name: Basic (${{matrix.os}},
compilers=${{matrix.compiler.c}}/${{matrix.compiler.cxx}},
shared_library=${{matrix.shared_library}},
level_zero_provider=${{matrix.level_zero_provider}},
cuda_provider=${{matrix.cuda_provider}},
cmake_ver=${{matrix.cmake_ver || 'default'}},
umfd=${{matrix.umfd_lib || 'OFF'}})
extra=${{matrix.extra_release_build_type || ''}}
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Install cmake (non-default version)
if: ${{ matrix.cmake_ver != 'default' && matrix.cmake_ver != '' }}
run: |
$ErrorActionPreference = "Stop"
$cmakePath = "C:\Program Files\CMake"
if (Test-Path -Path $cmakePath) {
Write-Host "Removing existing CMake installation..."
Remove-Item -Recurse -Force -Path $cmakePath
}
$cmakeInstaller = "cmake-${{matrix.cmake_ver}}.msi"
$cmakeInstallerParts = $cmakeInstaller -split '-|\.'
$cmakeMajorMinorPatch = "$($cmakeInstallerParts[1]).$($cmakeInstallerParts[2]).$($cmakeInstallerParts[3])"
$cmakeUrl = "https://github.com/Kitware/CMake/releases/download/v$cmakeMajorMinorPatch/$cmakeInstaller"
Write-Host "Downloading CMake version ${{matrix.cmake_ver}}..."
Invoke-WebRequest -Uri $cmakeUrl -OutFile $cmakeInstaller -TimeoutSec 360
Write-Host "Installing CMake version ${{matrix.cmake_ver}}..."
Start-Process msiexec.exe -ArgumentList "/i $cmakeInstaller /quiet /norestart" -Wait
cmake --version
# Ensure that the required environment is set
# Note: While this step is required for the clang-cl compiler, it can be executed for all jobs
- name: Setup MSVC dev command prompt
uses: TheMrMilchmann/setup-msvc-dev@79dac248aac9d0059f86eae9d8b5bfab4e95e97c # v4.0.0
with:
arch: x64
- name: Restore vcpkg cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
id: cache
with:
path: vcpkg_pkgs_cache.zip
key: vcpkg-basic-${{matrix.os}}-${{ hashFiles('vcpkg.json') }}
- name: Unpack vcpkg cache
if: steps.cache.outputs.cache-hit == 'true'
run: |
Expand-Archive -Path ${{github.workspace}}/vcpkg_pkgs_cache.zip -DestinationPath ${{github.workspace}}/vcpkg -Force
- name: Initialize vcpkg
if: steps.cache.outputs.cache-hit != 'true'
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{github.workspace}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: vcpkg install --triplet x64-windows
# Older versions of CMake require this step to correctly locate dependencies
- name: Add vcpkg bin dirs to PATH
run: |
$env:Path = "${{env.VCPKG_PATH_BIN}};$env:Path"
echo "PATH=$env:Path" >> $env:GITHUB_ENV
- name: Get UMF version
run: |
$version = (git describe --tags --abbrev=0 | Select-String -Pattern '\d+\.\d+\.\d+').Matches.Value
echo "UMF_VERSION=$version" >> $env:GITHUB_ENV
- name: Configure build (Debug)
run: >
cmake
-B ${{env.BUILD_DEBUG_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_USE_DEBUG_POSTFIX=${{matrix.umfd_lib || 'OFF'}}
- name: Build UMF (Debug)
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j $Env:NUMBER_OF_PROCESSORS
- name: Run tests (Debug)
working-directory: ${{env.BUILD_DEBUG_DIR}}
# For CMake versions < 3.22 we have to add the build directory to the PATH manually
# Extra paths without 'build_type' are set for NMake generator
run: |
$m = [regex]::Matches((cmake --version), "cmake version (\d+)\.(\d+)\.(\d+)")
if ($m) {
$major = [int]$m.groups[1].Value
$minor = [int]$m.groups[2].Value
if ($major -lt 3 -or ($major -eq 3 -and $minor -lt 22)) {
$env:Path = "${{env.BUILD_DEBUG_DIR}}/bin/Debug;${{env.BUILD_DEBUG_DIR}}/src/proxy_lib/Debug;$env:Path"
$env:Path = "${{env.BUILD_DEBUG_DIR}}/bin/;${{env.BUILD_DEBUG_DIR}}/src/proxy_lib/;$env:Path"
echo "PATH=$env:Path" >> $env:GITHUB_ENV
}
}
ctest -C Debug --output-on-failure --test-dir test
shell: pwsh
- name: Test UMF installation and uninstallation (Debug)
run: >
python3 ${{github.workspace}}/test/test_installation.py
--build-dir ${{env.BUILD_DEBUG_DIR}}
--install-dir ${{env.INSTL_DEBUG_DIR}}
--build-type Debug
${{matrix.shared_library == 'ON' && '--proxy' || '' }}
--umf-version ${{env.UMF_VERSION}}
${{ matrix.shared_library == 'ON' && '--shared-library' || ''}}
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}
- name: Configure build (Release)
run: >
cmake
-B ${{env.BUILD_RELEASE_DIR}}
${{matrix.extra_release_build_type || ''}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_USE_DEBUG_POSTFIX=${{matrix.umfd_lib || 'OFF'}}
- name: Build UMF (Release)
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j $Env:NUMBER_OF_PROCESSORS
- name: Run tests (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
# For CMake versions < 3.22 we have to add the build directory to the PATH manually
# Extra paths without 'build_type' are set for NMake generator
run: |
$m = [regex]::Matches((cmake --version), "cmake version (\d+)\.(\d+)\.(\d+)")
if ($m) {
$major = [int]$m.groups[1].Value
$minor = [int]$m.groups[2].Value
if ($major -lt 3 -or ($major -eq 3 -and $minor -lt 22)) {
$env:Path = "${{env.BUILD_RELEASE_DIR}}/bin/Release;${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release;$env:Path"
$env:Path = "${{env.BUILD_RELEASE_DIR}}/bin/;${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/;$env:Path"
echo "PATH=$env:Path" >> $env:GITHUB_ENV
}
}
ctest -C Release --output-on-failure --test-dir test
shell: pwsh
- name: Test UMF installation and uninstallation (Release)
run: >
python3 ${{github.workspace}}/test/test_installation.py
--build-dir ${{env.BUILD_RELEASE_DIR}}
--install-dir ${{env.INSTL_RELEASE_DIR}}
--build-type Release
${{matrix.shared_library == 'ON' && '--proxy' || '' }}
--umf-version ${{env.UMF_VERSION}}
${{ matrix.shared_library == 'ON' && '--shared-library' || ''}}
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}
- name: check /DEPENDENTLOADFLAG in umf.dll (Release)
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll
shell: pwsh
- name: check /DEPENDENTLOADFLAG in umf_proxy.dll (Release)
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release/umf_proxy.dll
shell: pwsh
- name: Prepare vcpkg cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
Compress-Archive -Path ${{github.workspace}}/vcpkg/packages -DestinationPath ${{github.workspace}}/vcpkg_pkgs_cache.zip -Force -CompressionLevel Fastest
- name: Save vcpkg cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{github.workspace}}/vcpkg_pkgs_cache.zip
key: ${{ steps.cache.outputs.cache-primary-key }}
windows-dynamic_build_hwloc:
name: "Windows dynamic UMF + static hwloc"
strategy:
matrix:
build_type: [Release]
runs-on: 'windows-latest'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Configure build
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DUMF_BUILD_SHARED_LIBRARY=ON
-DUMF_BUILD_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_LINK_HWLOC_STATICALLY=ON
- name: Build UMF
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
- name: Run tests
working-directory: ${{env.BUILD_DIR}}
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
# we check umf.dll only here - note that the proxy library is disabled in
# this configuration
- name: check /DEPENDENTLOADFLAG in umf.dll
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll
shell: pwsh
windows-static_build_hwloc:
name: "Windows static UMF + static hwloc"
strategy:
matrix:
build_type: [Release]
runs-on: 'windows-latest'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Configure build
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DUMF_BUILD_SHARED_LIBRARY=OFF
-DUMF_BUILD_EXAMPLES=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_LINK_HWLOC_STATICALLY=ON
- name: Build UMF
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS -v
- name: Run tests
working-directory: ${{env.BUILD_DIR}}
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
macos-build:
strategy:
matrix:
include:
- os: macos-14
static_hwloc: 'OFF'
- os: macos-15
static_hwloc: 'ON'
env:
BUILD_TYPE : "Release"
name: Basic (${{matrix.os}}, static_hwloc=${{matrix.static_hwloc}})
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
# Latest distros do not allow global pip installation
- name: Install Python requirements in venv
run: |
python3 -m venv .venv
. .venv/bin/activate
echo "$PATH" >> $GITHUB_PATH
python3 -m pip install -r third_party/requirements.txt
- name: Install dependencies
run: brew install --quiet jemalloc tbb automake libtool
- name: Install hwloc
if: ${{ matrix.static_hwloc == 'OFF' }}
run: brew install --quiet hwloc
- name: Get UMF version
run: |
VERSION=$(git describe --tags --abbrev=0 | grep -Eo '\d+\.\d+\.\d+')
echo "UMF_VERSION=$VERSION" >> $GITHUB_ENV
- name: Configure build
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_SHARED_LIBRARY=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.static_hwloc}}
- name: Build UMF
run: cmake --build ${{env.BUILD_DIR}} -j $(sysctl -n hw.logicalcpu)
- name: Test UMF installation and uninstallation
run: >
python3 ${{github.workspace}}/test/test_installation.py
--build-dir ${{env.BUILD_DIR}}
--install-dir ${{env.INSTL_DIR}}
--build-type ${{env.BUILD_TYPE}}
--proxy
--umf-version ${{env.UMF_VERSION}}
--shared-library