From c24f8fe3e0043dd573d6df40518ad6b8e8cef3ae Mon Sep 17 00:00:00 2001 From: Tamino Bauknecht Date: Wed, 20 Mar 2024 13:38:45 +0100 Subject: [PATCH] ci: Fixes for unittest/coverage ci and build ci --- .github/workflows/cpp-build.yml | 2 +- .github/workflows/cpp-unittest.yml | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cpp-build.yml b/.github/workflows/cpp-build.yml index b8feb28..c4d349a 100644 --- a/.github/workflows/cpp-build.yml +++ b/.github/workflows/cpp-build.yml @@ -56,4 +56,4 @@ jobs: - name: Install run: | cmake --install build - shell: alpine.sh {0} + shell: alpine.sh --root {0} diff --git a/.github/workflows/cpp-unittest.yml b/.github/workflows/cpp-unittest.yml index dd24a8a..cb1e55e 100644 --- a/.github/workflows/cpp-unittest.yml +++ b/.github/workflows/cpp-unittest.yml @@ -33,7 +33,7 @@ jobs: python3-dev \ fmt-dev \ gtest-dev \ - lcov + lcov gzip shell: alpine.sh --root {0} - name: Fixup environment run: | @@ -54,12 +54,28 @@ jobs: shell: alpine.sh {0} - name: Execute tests run: | - lcov -c -i -d . -o baseline_coverage + lcov --capture --initial \ + --directory . \ + --ignore-errors mismatch \ + --output-file baseline_coverage build/test/tests || echo $? - lcov -c -d . -o total_coverage - lcov -a baseline_coverage -a total_coverage -o measured_coverage - lcov -r measured_coverage "/usr*" -o coverage_without_system_files - lcov -r coverage_without_system_files "*/test/*" -o coverage_without_system_and_test_files - genhtml --output-directory coverage --legend coverage_without_system_and_test_files + lcov --capture \ + --directory . \ + --ignore-errors mismatch \ + --output-file total_coverage + lcov \ + --add-tracefile baseline_coverage \ + --add-tracefile total_coverage \ + --ignore-errors mismatch \ + --output-file measured_coverage + lcov --remove measured_coverage "/usr*" \ + --ignore-errors mismatch \ + --output-file coverage_without_system_files + lcov --remove coverage_without_system_files "*/test/*" \ + --ignore-errors mismatch \ + --output-file coverage_without_system_and_test_files + genhtml \ + --output-directory coverage \ + --legend coverage_without_system_and_test_files lcov --list coverage_without_system_and_test_files shell: alpine.sh {0}