Skip to content

Commit 8bb61a4

Browse files
Merge pull request #611 from ldorau/Do_not_run_cmake_inside_ctest_tests
Do not run cmake inside ctest tests
2 parents c39f4aa + d8583b4 commit 8bb61a4

File tree

9 files changed

+70
-44
lines changed

9 files changed

+70
-44
lines changed

.github/workflows/basic.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ permissions:
99
env:
1010
# for installation testing - it should match with version set in CMake
1111
UMF_VERSION: 0.1.0
12+
BUILD_DIR : "${{github.workspace}}/build"
13+
INSTL_DIR : "${{github.workspace}}/../install-dir"
1214

1315
jobs:
1416
ubuntu-build:
@@ -67,9 +69,6 @@ jobs:
6769
shared_library: 'ON'
6870
level_zero_provider: 'ON'
6971
install_tbb: 'OFF'
70-
env:
71-
BUILD_DIR : "${{github.workspace}}/build/"
72-
INSTL_DIR : "${{github.workspace}}/../install-dir"
7372
runs-on: ${{matrix.os}}
7473

7574
steps:
@@ -131,6 +130,9 @@ jobs:
131130
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh &&' || ''}}
132131
ctest --output-on-failure --test-dir test
133132
133+
- name: Remove the installation directory
134+
run: rm -rf ${{env.INSTL_DIR}}
135+
134136
- name: Test UMF installation and uninstallation
135137
# The '--shared-library' parameter is added to the installation test when the UMF is built as a shared library
136138
run: >
@@ -148,8 +150,6 @@ jobs:
148150
name: Windows
149151
env:
150152
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"
151-
BUILD_DIR : "${{github.workspace}}/build/"
152-
INSTL_DIR : "${{github.workspace}}/../install-dir"
153153
strategy:
154154
matrix:
155155
os: ['windows-2019', 'windows-2022']
@@ -185,7 +185,7 @@ jobs:
185185
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
186186
with:
187187
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
188-
vcpkgDirectory: ${{github.workspace}}/build/vcpkg
188+
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
189189
vcpkgJsonGlob: '**/vcpkg.json'
190190

191191
- name: Install dependencies
@@ -197,6 +197,7 @@ jobs:
197197
cmake
198198
-B ${{env.BUILD_DIR}}
199199
${{matrix.toolset}}
200+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
200201
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
201202
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
202203
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
@@ -230,18 +231,16 @@ jobs:
230231
231232
- name: check /DEPENDENTLOADFLAG in umf.dll
232233
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
233-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/bin/${{matrix.build_type}}/umf.dll
234+
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll
234235
shell: pwsh
235236

236237
- name: check /DEPENDENTLOADFLAG in umf_proxy.dll
237238
if: ${{matrix.compiler.cxx == 'cl'}}
238-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/src/proxy_lib/${{matrix.build_type}}/umf_proxy.dll
239+
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/src/proxy_lib/${{matrix.build_type}}/umf_proxy.dll
239240
shell: pwsh
240241

241242
windows-dynamic_build_hwloc:
242243
name: "Windows dynamic UMF + static hwloc"
243-
env:
244-
BUILD_DIR : "${{github.workspace}}/build"
245244
strategy:
246245
matrix:
247246
build_type: [Release]
@@ -256,6 +255,7 @@ jobs:
256255
run: >
257256
cmake
258257
-B ${{env.BUILD_DIR}}
258+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
259259
-DUMF_BUILD_SHARED_LIBRARY=ON
260260
-DUMF_BUILD_EXAMPLES=OFF
261261
-DUMF_FORMAT_CODE_STYLE=OFF
@@ -276,13 +276,11 @@ jobs:
276276
# we check umf.dll only here - note that the proxy library is disabled in
277277
# this configuration
278278
- name: check /DEPENDENTLOADFLAG in umf.dll
279-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/bin/${{matrix.build_type}}/umf.dll
279+
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll
280280
shell: pwsh
281281

282282
windows-static_build_hwloc:
283283
name: "Windows static UMF + static hwloc"
284-
env:
285-
BUILD_DIR : "${{github.workspace}}/build"
286284
strategy:
287285
matrix:
288286
build_type: [Release]
@@ -297,6 +295,7 @@ jobs:
297295
run: >
298296
cmake
299297
-B ${{env.BUILD_DIR}}
298+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
300299
-DUMF_BUILD_SHARED_LIBRARY=OFF
301300
-DUMF_BUILD_EXAMPLES=OFF
302301
-DUMF_FORMAT_CODE_STYLE=OFF
@@ -320,8 +319,6 @@ jobs:
320319
matrix:
321320
os: ['macos-12', 'macos-13']
322321
env:
323-
BUILD_DIR : "${{github.workspace}}/build/"
324-
INSTL_DIR : "${{github.workspace}}/../install-dir"
325322
BUILD_TYPE : "Release"
326323
runs-on: ${{matrix.os}}
327324

@@ -339,6 +336,7 @@ jobs:
339336
run: >
340337
cmake
341338
-B ${{env.BUILD_DIR}}
339+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
342340
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
343341
-DUMF_FORMAT_CODE_STYLE=OFF
344342
-DUMF_DEVELOPER_MODE=ON

.github/workflows/benchmarks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ on: workflow_call
66
permissions:
77
contents: read
88

9+
env:
10+
BUILD_DIR : "${{github.workspace}}/build"
11+
INSTL_DIR : "${{github.workspace}}/../install-dir"
12+
913
jobs:
1014
benchmarks:
1115
name: Benchmarks
1216
env:
13-
BUILD_DIR : "${{github.workspace}}/build/"
1417
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"
1518
strategy:
1619
matrix:
@@ -49,6 +52,7 @@ jobs:
4952
cmake
5053
-B ${{env.BUILD_DIR}}
5154
${{matrix.extra_build_option}}
55+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
5256
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
5357
-DUMF_BUILD_SHARED_LIBRARY=ON
5458
-DUMF_BUILD_BENCHMARKS=ON

.github/workflows/codeql.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ concurrency:
1818
permissions:
1919
contents: read
2020

21+
env:
22+
BUILD_DIR : "${{github.workspace}}/build"
23+
INSTL_DIR : "${{github.workspace}}/../install-dir"
24+
2125
jobs:
2226
analyze:
2327
name: Analyze
@@ -50,7 +54,7 @@ jobs:
5054
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
5155
with:
5256
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
53-
vcpkgDirectory: ${{github.workspace}}/build/vcpkg
57+
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
5458
vcpkgJsonGlob: '**/vcpkg.json'
5559

5660
- name: Install dependencies
@@ -70,8 +74,9 @@ jobs:
7074
- name: Configure CMake
7175
run: >
7276
cmake
73-
-B ${{github.workspace}}/build
77+
-B ${{env.BUILD_DIR}}
7478
${{matrix.extra_build_option}}
79+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
7580
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
7681
-DUMF_FORMAT_CODE_STYLE=OFF
7782
-DUMF_DEVELOPER_MODE=ON
@@ -80,7 +85,7 @@ jobs:
8085
-DUMF_TESTS_FAIL_ON_SKIP=ON
8186
8287
- name: Build
83-
run: cmake --build ${{github.workspace}}/build --config Release -j
88+
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
8489

8590
- name: Perform CodeQL Analysis
8691
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2

.github/workflows/fast.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on: workflow_call
66
permissions:
77
contents: read
88

9+
env:
10+
BUILD_DIR : "${{github.workspace}}/build"
11+
INSTL_DIR : "${{github.workspace}}/../install-dir"
12+
913
jobs:
1014
FastBuild:
1115
name: Fast builds
@@ -61,7 +65,7 @@ jobs:
6165
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
6266
with:
6367
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
64-
vcpkgDirectory: ${{github.workspace}}/build/vcpkg
68+
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
6569
vcpkgJsonGlob: '**/vcpkg.json'
6670

6771
- name: Install dependencies
@@ -90,7 +94,8 @@ jobs:
9094
if: matrix.simple_cmake == 'OFF'
9195
run: >
9296
cmake
93-
-B ${{github.workspace}}/build
97+
-B ${{env.BUILD_DIR}}
98+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
9499
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
95100
-DUMF_FORMAT_CODE_STYLE=OFF
96101
-DUMF_DEVELOPER_MODE=ON
@@ -107,29 +112,30 @@ jobs:
107112
if: matrix.simple_cmake == 'ON'
108113
run: >
109114
cmake
110-
-B ${{github.workspace}}/build
115+
-B ${{env.BUILD_DIR}}
116+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
111117
-DUMF_BUILD_SHARED_LIBRARY=ON
112118
-DUMF_TESTS_FAIL_ON_SKIP=ON
113119
${{matrix.extra_build_options}}
114120
115121
- name: Build
116-
run: cmake --build ${{github.workspace}}/build --config Release -j
122+
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
117123

118124
- name: Run examples
119-
working-directory: ${{github.workspace}}/build
125+
working-directory: ${{env.BUILD_DIR}}
120126
run: ctest --output-on-failure --test-dir examples -C Release
121127

122128
- name: Run tests
123129
if: matrix.build_tests == 'ON'
124-
working-directory: ${{github.workspace}}/build
130+
working-directory: ${{env.BUILD_DIR}}
125131
run: ctest --output-on-failure --test-dir test -C Release
126132

127133
- name: check /DEPENDENTLOADFLAG (Windows only)
128134
if: matrix.os == 'windows-latest'
129-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/bin/Release/umf.dll
135+
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/Release/umf.dll
130136
shell: pwsh
131137

132138
- name: check /DEPENDENTLOADFLAG in umf_proxy.dll
133139
if: matrix.os == 'windows-latest'
134-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll
140+
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/src/proxy_lib/Release/umf_proxy.dll
135141
shell: pwsh

.github/workflows/gpu.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on: [workflow_call]
88
permissions:
99
contents: read
1010

11+
env:
12+
BUILD_DIR : "${{github.workspace}}/build"
13+
INSTL_DIR : "${{github.workspace}}/../install-dir"
14+
1115
jobs:
1216
gpu:
1317
name: Build
@@ -42,7 +46,8 @@ jobs:
4246
run: >
4347
cmake
4448
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
45-
-B ${{github.workspace}}/build
49+
-B ${{env.BUILD_DIR}}
50+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
4651
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
4752
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
4853
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
@@ -62,7 +67,8 @@ jobs:
6267
if: matrix.os == 'Ubuntu'
6368
run: >
6469
cmake
65-
-B ${{github.workspace}}/build
70+
-B ${{env.BUILD_DIR}}
71+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
6672
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
6773
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
6874
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
@@ -79,16 +85,16 @@ jobs:
7985
-DUMF_TESTS_FAIL_ON_SKIP=ON
8086
8187
- name: Build UMF
82-
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j ${{matrix.number_of_processors}}
88+
run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} -j ${{matrix.number_of_processors}}
8389

8490
- name: Run tests
85-
working-directory: ${{github.workspace}}/build
91+
working-directory: ${{env.BUILD_DIR}}
8692
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure --test-dir test
8793

8894
- name: Run examples
89-
working-directory: ${{github.workspace}}/build
95+
working-directory: ${{env.BUILD_DIR}}
9096
run: ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE}}
9197

9298
- name: Run benchmarks
93-
working-directory: ${{github.workspace}}/build
99+
working-directory: ${{env.BUILD_DIR}}
94100
run: ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded

.github/workflows/proxy_lib.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on: workflow_call
66
permissions:
77
contents: read
88

9+
env:
10+
BUILD_DIR : "${{github.workspace}}/build"
11+
INSTL_DIR : "${{github.workspace}}/../install-dir"
12+
913
jobs:
1014
proxy-ubuntu:
1115
name: Ubuntu
@@ -33,7 +37,8 @@ jobs:
3337
- name: Configure build
3438
run: >
3539
cmake
36-
-B ${{github.workspace}}/build
40+
-B ${{env.BUILD_DIR}}
41+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
3742
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
3843
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
3944
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
@@ -48,20 +53,20 @@ jobs:
4853
-DUMF_PROXY_LIB_BASED_ON_POOL=${{matrix.proxy_lib_pool}}
4954
5055
- name: Build UMF
51-
run: cmake --build ${{github.workspace}}/build -j $(nproc)
56+
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
5257

5358
- name: Run "ctest --output-on-failure" with proxy library
54-
working-directory: ${{github.workspace}}/build
59+
working-directory: ${{env.BUILD_DIR}}
5560
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure
5661

5762
- name: Run "./test/umf_test-memoryPool" with proxy library
58-
working-directory: ${{github.workspace}}/build
63+
working-directory: ${{env.BUILD_DIR}}
5964
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/umf_test-memoryPool
6065

6166
- name: Run "/usr/bin/ls" with proxy library
62-
working-directory: ${{github.workspace}}/build
67+
working-directory: ${{env.BUILD_DIR}}
6368
run: LD_PRELOAD=./lib/libumf_proxy.so /usr/bin/ls
6469

6570
- name: Run "/usr/bin/date" with proxy library
66-
working-directory: ${{github.workspace}}/build
71+
working-directory: ${{env.BUILD_DIR}}
6772
run: LD_PRELOAD=./lib/libumf_proxy.so /usr/bin/date

.github/workflows/sanitizers.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ name: Sanitizers
44
on: workflow_call
55

66
env:
7-
BUILD_DIR : "${{github.workspace}}/build/"
7+
BUILD_DIR : "${{github.workspace}}/build"
8+
INSTL_DIR : "${{github.workspace}}/../install-dir"
89

910
permissions:
1011
contents: read
@@ -46,6 +47,7 @@ jobs:
4647
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh &&' || ''}}
4748
cmake
4849
-B ${{env.BUILD_DIR}}
50+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
4951
-DCMAKE_BUILD_TYPE=Debug
5052
-DUMF_BUILD_SHARED_LIBRARY=OFF
5153
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
@@ -103,7 +105,7 @@ jobs:
103105
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
104106
with:
105107
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
106-
vcpkgDirectory: ${{github.workspace}}/build/vcpkg
108+
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
107109
vcpkgJsonGlob: '**/vcpkg.json'
108110

109111
- name: Install dependencies
@@ -115,6 +117,7 @@ jobs:
115117
run: >
116118
cmake
117119
-B ${{env.BUILD_DIR}}
120+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
118121
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
119122
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
120123
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ if(LINUX
431431
NAME umf_standalone_examples
432432
COMMAND
433433
${UMF_CMAKE_SOURCE_DIR}/test/test_examples.sh
434-
${UMF_CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
435-
${CMAKE_BINARY_DIR}/install ${EXAMPLES}
434+
${UMF_CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_INSTALL_PREFIX}
435+
${EXAMPLES}
436436
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
437437
endif()

0 commit comments

Comments
 (0)