-
Notifications
You must be signed in to change notification settings - Fork 15
81 lines (71 loc) · 2.32 KB
/
coverage.yml
File metadata and controls
81 lines (71 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Coverage
permissions: read-all
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- main
- v2.x
pull_request:
branches:
- master
- main
- v2.x
paths-ignore:
- '**.md'
- '**.rst'
- 'doc/**'
env:
BUILD_TYPE: Debug
INSTALL_DIR: install
jobs:
# Job producing code coverage report
# ==================================
Code_coverage:
runs-on: ubuntu-24.04
steps:
- name: "Install libraries"
run: |
sudo apt-get update
sudo apt-get install ninja-build gcc-11 g++-11
sudo apt-get install libhdf5-dev libsz2 libboost-all-dev libeigen3-dev libopencv-dev
sudo apt-get install libxtensor-dev
# Install lcov 1.15-1 from Ubuntu 22.04 to avoid geninfo template mismatch errors
wget http://archive.ubuntu.com/ubuntu/pool/universe/l/lcov/lcov_1.15-1_all.deb
sudo dpkg -i lcov_1.15-1_all.deb || sudo apt-get install -f -y
sudo apt-mark hold lcov
- uses: actions/checkout@v6
with:
fetch-depth: 1
submodules: true
- name: Build for code coverage
run: |
CMAKE_OPTIONS=(
-GNinja
-DCMAKE_C_COMPILER=gcc-11
-DCMAKE_CXX_COMPILER=g++-11
-DHIGHFIVE_TEST_BOOST:BOOL=ON
-DHIGHFIVE_TEST_EIGEN:BOOL=ON
-DHIGHFIVE_TEST_OPENCV:BOOL=ON
-DHIGHFIVE_TEST_XTENSOR:BOOL=ON
-DHIGHFIVE_TEST_SINGLE_INCLUDES=ON
-DHIGHFIVE_HAS_WERROR:BOOL=OFF
-DHIGHFIVE_BUILD_DOCS:BOOL=FALSE
-DCMAKE_CXX_FLAGS="-coverage -O0"
)
source $GITHUB_WORKSPACE/.github/build.sh
- name: Test for code coverage
run: |
lcov --gcov-tool gcov-11 --capture --initial --directory . --no-external --output-file build/coverage-base.info
(cd build; cmake --build . --target test)
lcov --gcov-tool gcov-11 --capture --directory . --no-external --output-file build/coverage-run.info
(cd build; lcov --add-tracefile coverage-base.info --add-tracefile coverage-run.info --output-file coverage-combined.info)
- uses: codecov/codecov-action@v5
with:
files: ./build/coverage-combined.info
fail_ci_if_error: false
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}