@@ -7,21 +7,15 @@ name: Coverage
77on :
88 push :
99 branches :
10- # Push events to branches matching refs/heads/main
1110 - ' main'
12- # Push events to branches matching refs/heads/release*
13- - ' release*'
14- # Trigger after PR was unlabeled
1511 pull_request :
1612 types :
1713 - unlabeled
18- # Enables a manual trigger, may run on any branch
1914 workflow_dispatch :
2015
21- # Do not cancel on push events
2216concurrency :
2317 group : coverage-${{ github.event.pull_request.number || github.ref }}
24- cancel-in-progress : false # PRs will be canceled by the clang-format CI
18+ cancel-in-progress : false
2519
2620env :
2721 SHARG_NO_VERSION_CHECK : 1
@@ -33,70 +27,72 @@ defaults:
3327
3428jobs :
3529 build :
36- name : ${{ matrix.name }}
37- runs-on : ubuntu-22.04
38- timeout-minutes : 120
30+ runs-on : ubuntu-latest
31+ name : ${{ matrix.compiler }}
3932 if : github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
4033 strategy :
41- fail-fast : true
34+ fail-fast : false
4235 matrix :
43- include :
44- - name : " gcc13"
45- compiler : " gcc-13"
46- build : coverage
47- build_type : Coverage
48-
36+ compiler : ["gcc-14"]
37+ container :
38+ image : ghcr.io/seqan/${{ matrix.compiler }}
39+ volumes :
40+ - /home/runner:/home/runner
4941 steps :
50- # How many commits do we need to fetch to also fetch the branch point?
51- - name : Get fetch depth
52- id : fetch_depth
53- run : echo "depth=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> $GITHUB_OUTPUT
54-
5542 - name : Checkout
5643 uses : actions/checkout@v4
5744 with :
58- path : sharg
59- fetch-depth : ${{ steps.fetch_depth.outputs.depth }}
45+ fetch-depth : 0
6046 submodules : true
6147
62- - name : Setup toolchain
63- uses : seqan/actions/setup-toolchain@main
64- with :
65- compiler : ${{ matrix.compiler }}
66- ccache_size : 125M
67-
68- - name : Install CMake
69- uses : seqan/actions/setup-cmake@main
48+ - name : Load ccache
49+ uses : actions/cache@v4
7050 with :
71- cmake : 3.16.9
51+ path : /home/runner/.ccache
52+ key : ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }}-${{ github.run_id }}
53+ restore-keys : |
54+ ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }}
55+ ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}
7256
73- - name : Install gcovr
74- run : |
75- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100
76- pip install gcovr==6.0
57+ - name : Increase ccache size
58+ run : echo "CCACHE_MAXSIZE=300M" >> "${GITHUB_ENV}"
7759
7860 - name : Configure tests
7961 run : |
80- mkdir sharg-build
81- cd sharg-build
82- cmake ../sharg/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
83- -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
84- -DSHARG_VERBOSE_TESTS=OFF \
85- -DSHARG_COVERAGE_PARALLEL_LEVEL=2
86- make -j2 gtest_build yaml-cpp
62+ mkdir build && cd build
63+ cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage
64+ make gtest_build yaml-cpp
8765
8866 - name : Build tests
89- env :
90- CCACHE_IGNOREOPTIONS : " -fprofile-abs-path"
91- GCOV : ${{ github.workspace }}/sharg/.github/workflows/scripts/gcov.sh
67+ working-directory : build
9268 run : |
9369 ccache -z
94- cd sharg-build
95- make -k -j2
96- ccache -sv
70+ make -k
71+ ccache -svvx
72+
73+ - name : Run tests
74+ working-directory : build
75+ run : ctest . -j --output-on-failure --no-tests=error
76+
77+ - name : Generate coverage report
78+ run : |
79+ gcovr --root ${GITHUB_WORKSPACE}/test/coverage \
80+ ${GITHUB_WORKSPACE}/build \
81+ --filter ${GITHUB_WORKSPACE}/include/sharg \
82+ --filter ${GITHUB_WORKSPACE}/test/include/sharg/test \
83+ --exclude ${GITHUB_WORKSPACE}/include/sharg/contrib \
84+ --exclude ${GITHUB_WORKSPACE}/include/sharg/std \
85+ --exclude-lines-by-pattern '^\s*$' \
86+ --exclude-lines-by-pattern '^\s*};$' \
87+ --exclude-unreachable-branches \
88+ --exclude-throw-branches \
89+ --exclude-noncode-lines \
90+ -j \
91+ --cobertura \
92+ --output ${GITHUB_WORKSPACE}/build/coverage_report.xml
9793
9894 - name : Submit coverage build
99- uses : codecov/codecov-action@v3
95+ uses : codecov/codecov-action@v3.1.5
10096 with :
101- files : ${{ github.workspace }}/sharg- build/sharg_coverage .xml
102- root_dir : ${{ github.workspace }}/sharg
97+ files : build/coverage_report .xml
98+ fail_ci_if_error : false
0 commit comments