Skip to content

Commit

Permalink
ci: Fixes for unittest/coverage ci and build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
taminob committed Mar 20, 2024
1 parent cfd72c8 commit c24f8fe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cpp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
- name: Install
run: |
cmake --install build
shell: alpine.sh {0}
shell: alpine.sh --root {0}
30 changes: 23 additions & 7 deletions .github/workflows/cpp-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python3-dev \
fmt-dev \
gtest-dev \
lcov
lcov gzip
shell: alpine.sh --root {0}
- name: Fixup environment
run: |
Expand All @@ -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}

0 comments on commit c24f8fe

Please sign in to comment.