Skip to content

Commit 223583d

Browse files
committed
Add Basic builds to Coverage
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 2dc2548 commit 223583d

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

.github/workflows/basic.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
UMF_VERSION: 0.10.0
1212
BUILD_DIR : "${{github.workspace}}/build"
1313
INSTL_DIR : "${{github.workspace}}/../install-dir"
14+
COVERAGE_DIR : "${{github.workspace}}/coverage"
15+
COVERAGE_NAME : "exports-coverage-basic"
1416

1517
jobs:
1618
ubuntu-build:
@@ -122,8 +124,8 @@ jobs:
122124
- name: Install apt packages
123125
run: |
124126
sudo apt-get update
125-
sudo apt-get install -y clang cmake libnuma-dev libjemalloc-dev
126-
127+
sudo apt-get install -y clang cmake libnuma-dev libjemalloc-dev lcov
128+
127129
- name: Install TBB apt package
128130
if: matrix.install_tbb == 'ON'
129131
run: |
@@ -167,6 +169,7 @@ jobs:
167169
-DUMF_TESTS_FAIL_ON_SKIP=ON
168170
-DUMF_DISABLE_HWLOC=${{matrix.disable_hwloc}}
169171
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}}
172+
${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' && '-DUMF_USE_COVERAGE=ON' || '' }}
170173
171174
- name: Build UMF
172175
run: |
@@ -177,7 +180,23 @@ jobs:
177180
working-directory: ${{env.BUILD_DIR}}
178181
run: |
179182
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
180-
ctest --output-on-failure --test-dir test
183+
ctest --output-on-failure # run all tests for better coverage
184+
185+
- name: Check coverage
186+
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
187+
working-directory: ${{env.BUILD_DIR}}
188+
run: |
189+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-hwloc-${{matrix.disable_hwloc}}
190+
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
191+
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
192+
mkdir -p ${{env.COVERAGE_DIR}}
193+
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
194+
195+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
196+
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
197+
with:
198+
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-hwloc-${{matrix.disable_hwloc}}
199+
path: ${{env.COVERAGE_DIR}}
181200

182201
- name: Remove the installation directory
183202
run: rm -rf ${{env.INSTL_DIR}}

.github/workflows/coverage.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,30 @@ jobs:
2727
sudo apt-get update
2828
sudo apt-get install -y lcov
2929
30+
- name: Download file exports-coverage-basic-ubuntu-20.04-shared-OFF-hwloc-OFF
31+
uses: actions/download-artifact@v4
32+
with:
33+
name: exports-coverage-basic-ubuntu-20.04-shared-OFF-hwloc-OFF
34+
path: coverage
35+
36+
- name: Download file exports-coverage-basic-ubuntu-22.04-shared-OFF-hwloc-OFF
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: exports-coverage-basic-ubuntu-22.04-shared-OFF-hwloc-OFF
40+
path: coverage
41+
42+
- name: Download file exports-coverage-basic-ubuntu-24.04-shared-ON-hwloc-OFF
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: exports-coverage-basic-ubuntu-24.04-shared-ON-hwloc-OFF
46+
path: coverage
47+
48+
- name: Download file exports-coverage-basic-ubuntu-22.04-shared-ON-hwloc-ON
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: exports-coverage-basic-ubuntu-22.04-shared-ON-hwloc-ON
52+
path: coverage
53+
3054
- name: Compute coverage
3155
working-directory: ${{env.COVERAGE_DIR}}
3256
run: |

.github/workflows/pr_push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,6 @@ jobs:
110110
MultiNuma:
111111
needs: [Build]
112112
uses: ./.github/workflows/multi_numa.yml
113+
Coverage:
114+
needs: [Spellcheck, CodeStyle, Build]
115+
uses: ./.github/workflows/coverage.yml

0 commit comments

Comments
 (0)