@@ -12,19 +12,21 @@ permissions:
12
12
env :
13
13
BUILD_DIR : " ${{github.workspace}}/build"
14
14
INSTL_DIR : " ${{github.workspace}}/../install-dir"
15
+ COVERAGE_DIR : " ${{github.workspace}}/coverage"
15
16
16
17
jobs :
17
18
gpu :
18
19
name : Build
19
20
env :
20
- BUILD_TYPE : Release
21
21
VCPKG_PATH : " ${{github.workspace}}/../../../../vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/tbb_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/jemalloc_x64-windows"
22
+ COVERAGE_NAME : " exports-coverage-gpu"
22
23
# run only on upstream; forks will not have the HW
23
24
if : github.repository == 'oneapi-src/unified-memory-framework'
24
25
strategy :
25
26
matrix :
26
27
shared_library : ['ON', 'OFF']
27
28
os : ['Ubuntu', 'Windows']
29
+ build_type : ['Debug', 'Release']
28
30
include :
29
31
- os : ' Ubuntu'
30
32
compiler : {c: gcc, cxx: g++}
51
53
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
52
54
-B ${{env.BUILD_DIR}}
53
55
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
54
- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
56
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
55
57
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
56
58
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
57
59
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
73
75
cmake
74
76
-B ${{env.BUILD_DIR}}
75
77
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
76
- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
78
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
77
79
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
78
80
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
79
81
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -88,31 +90,49 @@ jobs:
88
90
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
89
91
-DUMF_BUILD_CUDA_PROVIDER=OFF
90
92
-DUMF_TESTS_FAIL_ON_SKIP=ON
93
+ ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
91
94
92
95
- name : Build UMF
93
- run : cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE }} -j ${{matrix.number_of_processors}}
96
+ run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type }} -j ${{matrix.number_of_processors}}
94
97
95
98
- name : Run tests
96
99
working-directory : ${{env.BUILD_DIR}}
97
- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure --test-dir test
100
+ run : ctest -C ${{matrix.build_type }} --output-on-failure --test-dir test
98
101
99
102
- name : Run examples
100
103
working-directory : ${{env.BUILD_DIR}}
101
- run : ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE }}
104
+ run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type }}
102
105
103
106
- name : Run benchmarks
104
107
working-directory : ${{env.BUILD_DIR}}
105
- run : ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
108
+ run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
109
+
110
+ - name : Check coverage
111
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
112
+ working-directory : ${{env.BUILD_DIR}}
113
+ run : |
114
+ export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
115
+ echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
116
+ ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
117
+ mkdir -p ${{env.COVERAGE_DIR}}
118
+ mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
119
+
120
+ - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
121
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
122
+ with :
123
+ name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
124
+ path : ${{env.COVERAGE_DIR}}
106
125
107
126
gpu-CUDA :
108
127
name : Build
109
128
env :
110
- BUILD_TYPE : Release
129
+ COVERAGE_NAME : " exports-coverage-gpu-CUDA "
111
130
# run only on upstream; forks will not have the HW
112
131
if : github.repository == 'oneapi-src/unified-memory-framework'
113
132
strategy :
114
133
matrix :
115
134
shared_library : ['ON', 'OFF']
135
+ build_type : ['Debug', 'Release']
116
136
# TODO add windows
117
137
os : ['Ubuntu']
118
138
include :
@@ -136,7 +156,7 @@ jobs:
136
156
run : >
137
157
cmake -B ${{env.BUILD_DIR}}
138
158
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
139
- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
159
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
140
160
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
141
161
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
142
162
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -151,18 +171,35 @@ jobs:
151
171
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
152
172
-DUMF_BUILD_CUDA_PROVIDER=ON
153
173
-DUMF_TESTS_FAIL_ON_SKIP=ON
174
+ ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
154
175
155
176
- name : Build UMF
156
- run : cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE }} -j ${{matrix.number_of_processors}}
177
+ run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type }} -j ${{matrix.number_of_processors}}
157
178
158
179
- name : Run tests
159
180
working-directory : ${{env.BUILD_DIR}}
160
- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure --test-dir test
181
+ run : ctest -C ${{matrix.build_type }} --output-on-failure --test-dir test
161
182
162
183
- name : Run examples
163
184
working-directory : ${{env.BUILD_DIR}}
164
- run : ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE }}
185
+ run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type }}
165
186
166
187
- name : Run benchmarks
167
188
working-directory : ${{env.BUILD_DIR}}
168
- run : ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
189
+ run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
190
+
191
+ - name : Check coverage
192
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
193
+ working-directory : ${{env.BUILD_DIR}}
194
+ run : |
195
+ export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
196
+ echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
197
+ ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
198
+ mkdir -p ${{env.COVERAGE_DIR}}
199
+ mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
200
+
201
+ - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
202
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
203
+ with :
204
+ name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
205
+ path : ${{env.COVERAGE_DIR}}
0 commit comments