Skip to content

Commit a2fa826

Browse files
authored
ci: update coverage.yml to ubuntu-24.04 (#102)
The default versions of gcc, gcov, geninfo and lcov don't work for our codebase. Therefore, we downgrade them all to the versions installed in unbuntu-22.04.
1 parent c1070f3 commit a2fa826

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/coverage.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,26 @@ on:
2323
- 'doc/**'
2424

2525
env:
26-
BUILD_TYPE: RelWithDebInfo
26+
BUILD_TYPE: Debug
2727
INSTALL_DIR: install
2828

2929
jobs:
3030
# Job producing code coverage report
3131
# ==================================
3232
Code_coverage:
33-
runs-on: ubuntu-22.04
33+
runs-on: ubuntu-24.04
3434

3535
steps:
3636
- name: "Install libraries"
3737
run: |
3838
sudo apt-get update
39-
sudo apt-get install ninja-build lcov
39+
sudo apt-get install ninja-build gcc-11 g++-11
4040
sudo apt-get install libhdf5-dev libsz2 libboost-all-dev libeigen3-dev libopencv-dev
4141
sudo apt-get install libxtensor-dev
42+
# Install lcov 1.15-1 from Ubuntu 22.04 to avoid geninfo template mismatch errors
43+
wget http://archive.ubuntu.com/ubuntu/pool/universe/l/lcov/lcov_1.15-1_all.deb
44+
sudo dpkg -i lcov_1.15-1_all.deb || sudo apt-get install -f -y
45+
sudo apt-mark hold lcov
4246
4347
- uses: actions/checkout@v6
4448
with:
@@ -49,21 +53,24 @@ jobs:
4953
run: |
5054
CMAKE_OPTIONS=(
5155
-GNinja
56+
-DCMAKE_C_COMPILER=gcc-11
57+
-DCMAKE_CXX_COMPILER=g++-11
5258
-DHIGHFIVE_TEST_BOOST:BOOL=ON
5359
-DHIGHFIVE_TEST_EIGEN:BOOL=ON
5460
-DHIGHFIVE_TEST_OPENCV:BOOL=ON
5561
-DHIGHFIVE_TEST_XTENSOR:BOOL=ON
5662
-DHIGHFIVE_TEST_SINGLE_INCLUDES=ON
63+
-DHIGHFIVE_HAS_WERROR:BOOL=OFF
5764
-DHIGHFIVE_BUILD_DOCS:BOOL=FALSE
5865
-DCMAKE_CXX_FLAGS="-coverage -O0"
5966
)
6067
source $GITHUB_WORKSPACE/.github/build.sh
6168
6269
- name: Test for code coverage
6370
run: |
64-
lcov --capture --initial --directory . --no-external --output-file build/coverage-base.info
71+
lcov --gcov-tool gcov-11 --capture --initial --directory . --no-external --output-file build/coverage-base.info
6572
(cd build; cmake --build . --target test)
66-
lcov --capture --directory . --no-external --output-file build/coverage-run.info
73+
lcov --gcov-tool gcov-11 --capture --directory . --no-external --output-file build/coverage-run.info
6774
(cd build; lcov --add-tracefile coverage-base.info --add-tracefile coverage-run.info --output-file coverage-combined.info)
6875
6976
- uses: codecov/codecov-action@v5

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ coverage:
66
patch:
77
default:
88
informational: true
9+
ignore:
10+
- "src/examples" # coverage doesn't come from examples

0 commit comments

Comments
 (0)