Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 9 additions & 27 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ name: coverage
env:
COBERTURA_REPORT: cobertura.xml
COVERALLS_REPORT: coveralls.json
JSON_REPORT: report.json
JSON_SUMMARY: summary.json
HTML_REPORT_DIR: html/
COVERAGE_ARTIFACT_NAME: coverage-report
Expand Down Expand Up @@ -36,7 +35,7 @@ jobs:

- name: Install gcovr
run: |
python -m pip install gcovr==8.3
python -m pip install git+https://github.com/gcovr/gcovr.git@3e5e4343658175fcf786092a06336e592ecb1ed0

- name: Print versions
run: |
Expand Down Expand Up @@ -87,50 +86,34 @@ jobs:
cd build
gcovr --root .. \
--verbose \
--include "${GITHUB_WORKSPACE}/include/mimic++(_ext)?" \
--filter "${GITHUB_WORKSPACE}/include/mimic++(_ext)?" \
--include "${GITHUB_WORKSPACE}/include" \
--filter "${GITHUB_WORKSPACE}/include" \
--exclude-lines-by-pattern "\s*(MIMICPP_ASSERT|assert|util::unreachable)\(" \
--exclude-unreachable-branches \
--exclude-function-lines \
--exclude-noncode-lines \
--exclude-throw-branches \
--merge-lines \
--decisions \
--calls \
--keep \
--txt \
--cobertura ${{env.COBERTURA_REPORT}} --cobertura-pretty \
--coveralls ${{env.COVERALLS_REPORT}} --coveralls-pretty \
--html-nested ${{env.HTML_REPORT_DIR}} --html-title "mimic++ Coverage Report" \
--json-summary ${{env.JSON_SUMMARY}} --json-summary-pretty \
--json ${{env.JSON_REPORT}} --json-pretty
--json-summary ${{env.JSON_SUMMARY}} --json-summary-pretty

mv ${{env.COBERTURA_REPORT}} ..
mv ${{env.COVERALLS_REPORT}} ..
mv ${{env.HTML_REPORT_DIR}} ..
mv ${{env.JSON_SUMMARY}} ..
mv ${{env.JSON_REPORT}} ..

# Gathering the coveralls.json in one go with all the other reports results in inconsistent reports.
# see: https://github.com/gcovr/gcovr/issues/1074
- name: Create coveralls report
run: |
cd build
gcovr --root .. \
--verbose \
--include "${GITHUB_WORKSPACE}/include/mimic++(_ext)?" \
--filter "${GITHUB_WORKSPACE}/include/mimic++(_ext)?" \
--add-tracefile ../${{env.JSON_REPORT}} \
--coveralls ${{env.COVERALLS_REPORT}} --coveralls-pretty

mv ${{env.COVERALLS_REPORT}} ..

- name: Find gcov-files
shell: bash
run: find . -type f -name "*.gcov"

# As of gcovr 8.4, these are *json.gz instead of *.gcov
- name: Upload gcov coverage report artifacts
uses: actions/upload-artifact@v4
with:
name: gcov-files
path: "**/*.gcov"
path: "**/*.json.gz"
if-no-files-found: error

- name: Upload generated report artifacts
Expand All @@ -140,7 +123,6 @@ jobs:
path: |
${{env.COBERTURA_REPORT}}
${{env.COVERALLS_REPORT}}
${{env.JSON_REPORT}}
${{env.JSON_SUMMARY}}
${{env.HTML_REPORT_DIR}}
if-no-files-found: error
Expand Down
Loading