Skip to content

Commit f06d542

Browse files
cakebakersylvestre
authored andcommitted
ci: use -Cinstrument-coverage instead of -Zprofile
Support for -Zprofile has been removed: rust-lang/rust#131829
1 parent 3a062a0 commit f06d542

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/ci.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,22 @@ jobs:
9090
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
9191
outputs TOOLCHAIN
9292
# target-specific options
93-
# * CARGO_FEATURES_OPTION
94-
CARGO_FEATURES_OPTION='--all -- --check' ; ## default to '--all-features' for code coverage
9593
# * CODECOV_FLAGS
9694
CODECOV_FLAGS=$( echo "${{ matrix.job.os }}" | sed 's/[^[:alnum:]]/_/g' )
9795
outputs CODECOV_FLAGS
9896
9997
- name: rust toolchain ~ install
10098
uses: dtolnay/rust-toolchain@nightly
99+
with:
100+
components: llvm-tools-preview
101101
- name: Test
102-
run: cargo test ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --no-fail-fast
102+
run: cargo test --no-fail-fast
103103
env:
104104
CARGO_INCREMENTAL: "0"
105105
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"
107107
RUSTDOCFLAGS: "-Cpanic=abort"
108+
LLVM_PROFILE_FILE: "ansi-width-%p-%m.profraw"
108109
- name: "`grcov` ~ install"
109110
id: build_grcov
110111
shell: bash
@@ -132,9 +133,9 @@ jobs:
132133
COVERAGE_REPORT_FILE="${COVERAGE_REPORT_DIR}/lcov.info"
133134
mkdir -p "${COVERAGE_REPORT_DIR}"
134135
# 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
136137
# 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\()"
138139
echo "name=report::${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
139140
- name: Upload coverage results (to Codecov.io)
140141
uses: codecov/codecov-action@v4

0 commit comments

Comments
 (0)