Skip to content

Commit c4c14e1

Browse files
committed
ci: use -Cinstrument-coverage instead of -Zprofile
Support for -Zprofile has been removed: rust-lang/rust#131829
1 parent dce8b2d commit c4c14e1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,17 @@ jobs:
103103
- name: Checkout source code
104104
uses: actions/checkout@v4
105105

106+
- name: Initialize workflow
107+
shell: bash
108+
run: |
109+
mkdir -p target/debug/coverage
110+
106111
- name: Install `rust` toolchain
107112
run: |
108113
## Install `rust` toolchain
109114
rustup toolchain install nightly --no-self-update -c rustfmt --profile minimal
110115
rustup default nightly
116+
rustup component add llvm-tools-preview
111117
112118
- name: "`grcov` ~ install"
113119
run: cargo install grcov
@@ -117,13 +123,15 @@ jobs:
117123
cargo test --all --no-fail-fast ${{ matrix.cargo_flags }}
118124
env:
119125
CARGO_INCREMENTAL: "0"
120-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
121-
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
126+
RUSTFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
127+
RUSTDOCFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off"
128+
LLVM_PROFILE_FILE: "target/debug/coverage/find-%p-%m.profraw"
122129

123130
- name: Generate coverage data
124131
id: grcov
125132
run: |
126133
grcov target/debug/ \
134+
--binary-path=target/debug/ \
127135
--branch \
128136
--llvm \
129137
--source-dir . \

0 commit comments

Comments
 (0)