@@ -90,21 +90,22 @@ jobs:
90
90
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
91
91
outputs TOOLCHAIN
92
92
# target-specific options
93
- # * CARGO_FEATURES_OPTION
94
- CARGO_FEATURES_OPTION='--all -- --check' ; ## default to '--all-features' for code coverage
95
93
# * CODECOV_FLAGS
96
94
CODECOV_FLAGS=$( echo "${{ matrix.job.os }}" | sed 's/[^[:alnum:]]/_/g' )
97
95
outputs CODECOV_FLAGS
98
96
99
97
- name : rust toolchain ~ install
100
98
uses : dtolnay/rust-toolchain@nightly
99
+ with :
100
+ components : llvm-tools-preview
101
101
- name : Test
102
- run : cargo test ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --no-fail-fast
102
+ run : cargo test --no-fail-fast
103
103
env :
104
104
CARGO_INCREMENTAL : " 0"
105
105
RUSTC_WRAPPER : " "
106
- RUSTFLAGS : " -Zprofile - Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
106
+ RUSTFLAGS : " -Cinstrument-coverage -Zcoverage-options=branch - Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
107
107
RUSTDOCFLAGS : " -Cpanic=abort"
108
+ LLVM_PROFILE_FILE : " ansi-width-%p-%m.profraw"
108
109
- name : " `grcov` ~ install"
109
110
id : build_grcov
110
111
shell : bash
@@ -132,9 +133,9 @@ jobs:
132
133
COVERAGE_REPORT_FILE="${COVERAGE_REPORT_DIR}/lcov.info"
133
134
mkdir -p "${COVERAGE_REPORT_DIR}"
134
135
# display coverage files
135
- grcov . --output-type files --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
136
+ grcov . --binary-path="${COVERAGE_REPORT_DIR}" -- output-type files --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
136
137
# generate coverage report
137
- grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
138
+ grcov . --binary-path="${COVERAGE_REPORT_DIR}" -- output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
138
139
echo "name=report::${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
139
140
- name : Upload coverage results (to Codecov.io)
140
141
uses : codecov/codecov-action@v4
0 commit comments