Skip to content

Commit f5f3f53

Browse files
committed
Add Basic builds to Coverage
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
1 parent b25d92c commit f5f3f53

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-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}}-no_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}}-no_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/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)