|
40 | 40 | - LCG_RELEASE: "LCG_108" |
41 | 41 | LCG_ARCH: "x86_64-ubuntu2204-gcc11-opt" |
42 | 42 | ROOT: "6.36.02" |
| 43 | + coverage: true |
43 | 44 | - LCG_RELEASE: "dev3/latest" |
44 | 45 | LCG_ARCH: "x86_64-ubuntu2204-gcc11-opt" |
45 | 46 | ROOT: "LCG master" |
|
56 | 57 | with: |
57 | 58 | cvmfs_repositories: ${{ (env.CMSSW_VERSION != '') && 'cms.cern.ch' || 'sft.cern.ch' }} |
58 | 59 |
|
| 60 | + - name: Setup compiler |
| 61 | + run: | |
| 62 | + echo "CC=$(which gcc)" >> $GITHUB_ENV |
| 63 | + echo "CXX=$(which g++)" >> $GITHUB_ENV |
| 64 | +
|
| 65 | + - name: Setup code coverage |
| 66 | + if: ${{ (matrix.coverage == true) }} |
| 67 | + run: | |
| 68 | + sudo apt install -y lcov |
| 69 | + # Workaround ubuntu lcov-1.15-1 package bug |
| 70 | + if sudo apt list lcov --installed | grep "1.15-1" ; then |
| 71 | + wget https://launchpad.net/ubuntu/+source/lcov/1.15-2/+build/23784466/+files/lcov_1.15-2_all.deb |
| 72 | + sudo apt install -y ./lcov_1.15-2_all.deb |
| 73 | + fi |
| 74 | + echo "COMBINE_CODE_COVERAGE=1" >> $GITHUB_ENV |
| 75 | + echo "BUILD_TYPE=Debug" >> $GITHUB_ENV |
| 76 | +
|
59 | 77 | - name: Build Combine (LCG) |
60 | 78 | if: ${{ env.CMSSW_VERSION == '' }} |
61 | 79 | env: |
|
70 | 88 | mkdir build; |
71 | 89 | cd build; |
72 | 90 | cmake -DCMAKE_INSTALL_PREFIX=../install \ |
73 | | - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 91 | + -DCMAKE_BUILD_TYPE=$([[ -z "$BUILD_TYPE" ]] && echo RelWithDebInfo || echo $BUILD_TYPE) \ |
| 92 | + -DCOMBINE_CODE_COVERAGE=${{ env.COMBINE_CODE_COVERAGE }} \ |
74 | 93 | -DUSE_VDT=${USE_VDT} \ |
75 | 94 | -DBUILD_TESTS=TRUE \ |
76 | 95 | ..; |
@@ -245,3 +264,28 @@ jobs: |
245 | 264 | script: | |
246 | 265 | cd test |
247 | 266 | python3 test_interference.py |
| 267 | +
|
| 268 | + - name: Prepare code coverage report |
| 269 | + if: ${{ success() && (matrix.coverage == true) }} |
| 270 | + run: | |
| 271 | + # Create lcov report |
| 272 | + # capture coverage info |
| 273 | + lcov --directory . --capture --output-file coverage.info --gcov-tool $CONDA_PREFIX/bin/gcov --ignore-errors gcov |
| 274 | + # filter out system and extra files. |
| 275 | + # To also not include test code in coverage add them with full path to the patterns: '*/ci/*' |
| 276 | + lcov --remove coverage.info \ |
| 277 | + '/usr/*' \ |
| 278 | + "${HOME}/.cache/*" \ |
| 279 | + '*/ci/*' \ |
| 280 | + --output-file coverage.info |
| 281 | + # output coverage data for debugging (optional) |
| 282 | + lcov --list coverage.info |
| 283 | +
|
| 284 | + - name: Upload to codecov.io |
| 285 | + if: ${{ success() && (matrix.coverage == true) }} |
| 286 | + uses: codecov/codecov-action@v5 |
| 287 | + with: |
| 288 | + files: ./coverage.info |
| 289 | + fail_ci_if_error: true |
| 290 | + verbose: true |
| 291 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments