From e47a5d92a896542bbbcc6160b7362694a07feac1 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Tue, 16 Apr 2024 19:49:02 +0100 Subject: [PATCH] Switch coverage format to LCOV --- .codecov.yml | 8 -------- .github/workflows/action.yml | 25 ++++++++++++++++++++----- tests/catch2 | 1 - 3 files changed, 20 insertions(+), 14 deletions(-) delete mode 120000 tests/catch2 diff --git a/.codecov.yml b/.codecov.yml index c49fa6e..6b45075 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -26,13 +26,5 @@ github_checks: slack_app: false -parsers: - gcov: - branch_detection: - conditional: true - loop: true - method: false - macro: false - ignore: - "tests/" diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index becb92d..400fe30 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -96,6 +96,9 @@ jobs: - name: configure shell: bash run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends lcov + sudo apt-get clean mkdir ${build_dir} cd ${build_dir} cmake \ @@ -106,19 +109,31 @@ jobs: -DCMAKE_CXX_FLAGS="-g --coverage -fprofile-abs-path -fno-early-inlining" \ .. - - name: build, run tests, prepare .gcov files + - name: build, run tests, prepare coverage data shell: bash run: | cd ${build_dir} - cmake --build . --target all - tests/tests -a # generate .gcda files - gcov -pbc $( find tests/ -type f -name '*.gcno' ) # generate .gcov files + cmake --build . + lcov --rc no_exception_branch=1 --rc lcov_branch_coverage=1 --no-external --capture --initial --directory $( realpath .. ) --output-file /tmp/base.info + tests/tests -a + lcov --rc no_exception_branch=1 --rc lcov_branch_coverage=1 --no-external --capture --directory $( realpath .. ) --output-file /tmp/test.info + lcov --rc no_exception_branch=1 --rc lcov_branch_coverage=1 --add-tracefile /tmp/base.info --add-tracefile /tmp/test.info --output-file /tmp/total.info + lcov --rc no_exception_branch=1 --rc lcov_branch_coverage=1 --remove /tmp/total.info "$( realpath . )/*" "$( realpath ../tests )/*" --output-file /tmp/filtered.info + cp /tmp/filtered.info "$( realpath .. )/coverage.txt" + + - name: archive coverage data + uses: actions/upload-artifact@v4 + with: + name: coverage.lcov + path: coverage.lcov + retention-days: 30 - name: upload coverage report uses: codecov/codecov-action@v4.3.0 with: fail_ci_if_error: true - disable_search: false + file: coverage.lcov + disable_search: true verbose: true plugin: noop token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/catch2 b/tests/catch2 deleted file mode 120000 index cae4eab..0000000 --- a/tests/catch2 +++ /dev/null @@ -1 +0,0 @@ -../third_party/catch2 \ No newline at end of file