Skip to content

Commit

Permalink
Trim the superfluous coverage sub-directory
Browse files Browse the repository at this point in the history
From `coverage/coverage` to just `coverage`.
  • Loading branch information
pcolby committed Jan 19, 2025
1 parent c425fe9 commit 0b90cf1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,9 @@ jobs:
# Combine all tracefiles into one. Note, ignoring inconsistencies between Clang and GCC reports :|
lcov --ignore-errors inconsistent $(find artifacts -name '*.info' -type f -printf '-a %p\n') -o coverage.info
# Generate the HTML report. Note, ignoring inconsistencies between Clang and GCC reports :|
genhtml --ignore-errors inconsistent --no-sort --output-directory coverage/coverage coverage.info
genhtml --ignore-errors inconsistent --no-sort --output-directory coverage coverage.info
# Can use any of the removeHtmlDates.sh scripts here, so the Ubuntu x86-64 GCC Qt6 job's version will do.
/usr/bin/env bash ./artifacts/test-results-*.x86-64.gcc.qt-6/coverage/removeHtmlDates.sh
/usr/bin/env bash ./artifacts/test-results-*.x86-64.gcc.qt-6/coverage/removeHtmlDates.sh coverage
# Remove build numbers from pre-releases, and remove extra build info (such as ".linux.x86-64.gcc.qt-6")
# from all releases, since this coverage report is an aggregation of many build hosts.
sed -i -Ee 's/(headerValue">([0-9]+\.){2}[0-9]+)(((-pre)\+[0-9]+)|(\+[0-9]+))\..*</\1\5\6</' \
Expand All @@ -747,7 +747,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: "${{ runner.temp }}/coverage/coverage"
path: "${{ runner.temp }}/coverage"
if-no-files-found: error
- name: Report partial-finished to Codacy
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ if (ENABLE_COVERAGE)
VERBATIM
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
endif()
configure_file(removeHtmlDates.sh.in ${PROJECT_BINARY_DIR}/removeHtmlDates.sh)
configure_file(removeHtmlDates.sh.in ${PROJECT_BINARY_DIR}/removeHtmlDates.sh @ONLY)
endif()
2 changes: 1 addition & 1 deletion test/removeHtmlDates.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ while IFS= read -d '' -r htmlFile; do
-e '/headerItem">Test:</{s/>.*:/>Project:/;n;s/>.*</>${PROJECT_NAME}</}' \
-e '/headerItem">(Test )?Date:</{s/>.*:/>Version:/;n;s/>.*</>${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX}</}' \
"$htmlFile" < /dev/null
done < <(find '${PROJECT_BINARY_DIR}/coverage/' -name '*.html' -print0)
done < <(find "${1:-@PROJECT_BINARY_DIR@/coverage/}" -name '*.html' -print0)

0 comments on commit 0b90cf1

Please sign in to comment.