mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
maint/CICD ~ use alternate grcov configuration recipe (direct CLI options)
- `ignore` and `excl-br-line` options used to target code coverage analysis - direct/repeated (non-DRY) CLI options are used by necessity (`grcov` is ignoring command line env variables)
This commit is contained in:
parent
c6274b4003
commit
bb4b20db81
1 changed files with 12 additions and 8 deletions
20
.github/workflows/CICD.yml
vendored
20
.github/workflows/CICD.yml
vendored
|
@ -508,11 +508,11 @@ jobs:
|
||||||
crate: grcov
|
crate: grcov
|
||||||
version: latest
|
version: latest
|
||||||
use-tool-cache: true
|
use-tool-cache: true
|
||||||
- name: "`grcov` ~ display coverage files" ## (for debugging)
|
# - name: "`grcov` ~ display coverage files" ## (for debugging)
|
||||||
shell: bash
|
# shell: bash
|
||||||
run: |
|
# run: |
|
||||||
# display coverage files (per `grcov`)
|
# # display coverage files (per `grcov`)
|
||||||
grcov . --output-type files | sort --unique
|
# grcov . --output-type files | sort --unique
|
||||||
# - name: "`grcov` ~ configure + fixups" ## note: fixups, when needed, must be done *after* testing so that coverage files exist for renaming
|
# - name: "`grcov` ~ configure + fixups" ## note: fixups, when needed, must be done *after* testing so that coverage files exist for renaming
|
||||||
# shell: bash
|
# shell: bash
|
||||||
# run: |
|
# run: |
|
||||||
|
@ -525,6 +525,7 @@ jobs:
|
||||||
# echo "- \"build.rs\"" >> "${GRCOV_CONFIG_FILE}"
|
# echo "- \"build.rs\"" >> "${GRCOV_CONFIG_FILE}"
|
||||||
# echo "- \"/*\"" >> "${GRCOV_CONFIG_FILE}"
|
# echo "- \"/*\"" >> "${GRCOV_CONFIG_FILE}"
|
||||||
# echo "- \"[a-zA-Z]:/*\"" >> "${GRCOV_CONFIG_FILE}"
|
# echo "- \"[a-zA-Z]:/*\"" >> "${GRCOV_CONFIG_FILE}"
|
||||||
|
# echo "excl-br-line: \"^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()\"" >> "${GRCOV_CONFIG_FILE}"
|
||||||
# cat "${GRCOV_CONFIG_FILE}"
|
# cat "${GRCOV_CONFIG_FILE}"
|
||||||
# # ## 'actions-rs/grcov@v0.1' expects coverage files (*.gc*) to be prefixed with the crate name (using '_' in place of '-')
|
# # ## 'actions-rs/grcov@v0.1' expects coverage files (*.gc*) to be prefixed with the crate name (using '_' in place of '-')
|
||||||
# # ## * uutils workspace packages
|
# # ## * uutils workspace packages
|
||||||
|
@ -542,10 +543,13 @@ jobs:
|
||||||
# generate coverage data
|
# generate coverage data
|
||||||
COVERAGE_REPORT_DIR="target/debug"
|
COVERAGE_REPORT_DIR="target/debug"
|
||||||
COVERAGE_REPORT_FILE="${COVERAGE_REPORT_DIR}/lcov.info"
|
COVERAGE_REPORT_FILE="${COVERAGE_REPORT_DIR}/lcov.info"
|
||||||
GRCOV_IGNORE_OPTION='--ignore build.rs --ignore "/*" --ignore "[a-zA-Z]:/*"'
|
# GRCOV_IGNORE_OPTION='--ignore build.rs --ignore "/*" --ignore "[a-zA-Z]:/*"' ## `grcov` ignores these params when passed as an environment variable (why?)
|
||||||
GRCOV_EXCLUDE_OPTION='--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"'
|
# GRCOV_EXCLUDE_OPTION='--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"' ## `grcov` ignores these params when passed as an environment variable (why?)
|
||||||
mkdir -p "${COVERAGE_REPORT_DIR}"
|
mkdir -p "${COVERAGE_REPORT_DIR}"
|
||||||
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch ${GRCOV_IGNORE_OPTION} ${GRCOV_EXCLUDE_OPTION}
|
# display coverage files
|
||||||
|
grcov . --output-type files --ignore build.rs --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
|
||||||
|
# generate coverage report
|
||||||
|
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
|
||||||
echo ::set-output name=report::${COVERAGE_REPORT_FILE}
|
echo ::set-output name=report::${COVERAGE_REPORT_FILE}
|
||||||
- name: Upload coverage results (to Codecov.io)
|
- name: Upload coverage results (to Codecov.io)
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue