@@ -12,26 +12,31 @@ permissions:
1212env :
1313 BUILD_DIR : " ${{github.workspace}}/build"
1414 INSTL_DIR : " ${{github.workspace}}/../install-dir"
15+ COVERAGE_DIR : " ${{github.workspace}}/coverage"
1516
1617jobs :
1718 gpu :
1819 name : Build
1920 env :
20- BUILD_TYPE : Release
2121 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"
2223 # run only on upstream; forks will not have the HW
2324 if : github.repository == 'oneapi-src/unified-memory-framework'
2425 strategy :
2526 matrix :
2627 shared_library : ['ON', 'OFF']
2728 os : ['Ubuntu', 'Windows']
29+ build_type : ['Debug', 'Release']
2830 include :
2931 - os : ' Ubuntu'
3032 compiler : {c: gcc, cxx: g++}
3133 number_of_processors : ' $(nproc)'
3234 - os : ' Windows'
3335 compiler : {c: cl, cxx: cl}
3436 number_of_processors : ' $Env:NUMBER_OF_PROCESSORS'
37+ exclude :
38+ - os : ' Windows'
39+ build_type : ' Debug'
3540
3641 runs-on : ["DSS-LEVEL_ZERO", "DSS-${{matrix.os}}"]
3742 steps :
5156 -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
5257 -B ${{env.BUILD_DIR}}
5358 -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
54- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
59+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
5560 -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
5661 -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
5762 -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
7378 cmake
7479 -B ${{env.BUILD_DIR}}
7580 -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
76- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
81+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
7782 -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
7883 -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
7984 -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -88,31 +93,49 @@ jobs:
8893 -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
8994 -DUMF_BUILD_CUDA_PROVIDER=OFF
9095 -DUMF_TESTS_FAIL_ON_SKIP=ON
96+ ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
9197
9298 - name : Build UMF
93- run : cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE }} -j ${{matrix.number_of_processors}}
99+ run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type }} -j ${{matrix.number_of_processors}}
94100
95101 - name : Run tests
96102 working-directory : ${{env.BUILD_DIR}}
97- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure --test-dir test
103+ run : ctest -C ${{matrix.build_type }} --output-on-failure --test-dir test
98104
99105 - name : Run examples
100106 working-directory : ${{env.BUILD_DIR}}
101- run : ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE }}
107+ run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type }}
102108
103109 - name : Run benchmarks
104110 working-directory : ${{env.BUILD_DIR}}
105- run : ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
111+ run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
112+
113+ - name : Check coverage
114+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
115+ working-directory : ${{env.BUILD_DIR}}
116+ run : |
117+ export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
118+ echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
119+ ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
120+ mkdir -p ${{env.COVERAGE_DIR}}
121+ mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
122+
123+ - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
124+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
125+ with :
126+ name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
127+ path : ${{env.COVERAGE_DIR}}
106128
107129 gpu-CUDA :
108130 name : Build
109131 env :
110- BUILD_TYPE : Release
132+ COVERAGE_NAME : " exports-coverage-gpu-CUDA "
111133 # run only on upstream; forks will not have the HW
112134 if : github.repository == 'oneapi-src/unified-memory-framework'
113135 strategy :
114136 matrix :
115137 shared_library : ['ON', 'OFF']
138+ build_type : ['Debug', 'Release']
116139 # TODO add windows
117140 os : ['Ubuntu']
118141 include :
@@ -136,7 +159,7 @@ jobs:
136159 run : >
137160 cmake -B ${{env.BUILD_DIR}}
138161 -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
139- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
162+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
140163 -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
141164 -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
142165 -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -151,18 +174,35 @@ jobs:
151174 -DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
152175 -DUMF_BUILD_CUDA_PROVIDER=ON
153176 -DUMF_TESTS_FAIL_ON_SKIP=ON
177+ ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
154178
155179 - name : Build UMF
156- run : cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE }} -j ${{matrix.number_of_processors}}
180+ run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type }} -j ${{matrix.number_of_processors}}
157181
158182 - name : Run tests
159183 working-directory : ${{env.BUILD_DIR}}
160- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure --test-dir test
184+ run : ctest -C ${{matrix.build_type }} --output-on-failure --test-dir test
161185
162186 - name : Run examples
163187 working-directory : ${{env.BUILD_DIR}}
164- run : ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE }}
188+ run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type }}
165189
166190 - name : Run benchmarks
167191 working-directory : ${{env.BUILD_DIR}}
168- run : ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
192+ run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
193+
194+ - name : Check coverage
195+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
196+ working-directory : ${{env.BUILD_DIR}}
197+ run : |
198+ export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
199+ echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
200+ ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
201+ mkdir -p ${{env.COVERAGE_DIR}}
202+ mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
203+
204+ - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
205+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
206+ with :
207+ name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
208+ path : ${{env.COVERAGE_DIR}}
0 commit comments