Skip to content

Commit 9d1a977

Browse files
committed
ci: use -Cinstrument-coverage instead of -Zprofile
and use cargo-llvm-cov instead of grcov. Support for -Zprofile has been removed from Rust nightly: rust-lang/rust#131829
1 parent 78e5201 commit 9d1a977

File tree

1 file changed

+4
-30
lines changed

1 file changed

+4
-30
lines changed

.github/workflows/ci.yml

+4-30
Original file line numberDiff line numberDiff line change
@@ -105,49 +105,23 @@ jobs:
105105

106106
- name: Install `rust` toolchain
107107
run: |
108-
## Install `rust` toolchain
109108
rustup toolchain install nightly --no-self-update -c rustfmt --profile minimal
110109
rustup default nightly
111110
112-
- name: "`grcov` ~ install"
113-
run: cargo install grcov
114-
115-
- name: cargo test
116-
run: |
117-
cargo test --all --no-fail-fast ${{ matrix.cargo_flags }}
118-
env:
119-
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"
111+
- name: Install cargo-llvm-cov
112+
uses: taiki-e/install-action@cargo-llvm-cov
113+
- name: Generate code coverage
114+
run: cargo llvm-cov --all-features --lcov --branch --output-path lcov.info
122115

123-
- name: Generate coverage data
124-
id: grcov
125-
run: |
126-
grcov target/debug/ \
127-
--branch \
128-
--llvm \
129-
--source-dir . \
130-
--output-path lcov.info \
131-
--ignore-not-existing \
132-
--excl-line "#\\[derive\\(" \
133-
--excl-br-line "#\\[derive\\(" \
134-
--excl-start "#\\[cfg\\(test\\)\\]" \
135-
--excl-br-start "#\\[cfg\\(test\\)\\]" \
136-
--commit-sha ${{ github.sha }} \
137-
--service-job-id ${{ github.job }} \
138-
--service-name "GitHub Actions" \
139-
--service-number ${{ github.run_id }}
140116
- name: Upload coverage as artifact
141117
uses: actions/upload-artifact@v4
142118
with:
143119
name: lcov.info
144-
# path: ${{ steps.grcov.outputs.report }}
145120
path: lcov.info
146121

147122
- name: Upload coverage to codecov.io
148123
uses: codecov/codecov-action@v4
149124
with:
150125
token: ${{ secrets.CODECOV_TOKEN }}
151-
# file: ${{ steps.grcov.outputs.report }}
152126
file: lcov.info
153127
fail_ci_if_error: true

0 commit comments

Comments
 (0)