From c60baeac6b6e7a15cfbabe0f7f50232d8425f847 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Fri, 8 Nov 2024 16:10:37 +0100 Subject: [PATCH] ci: use -Cinstrument-coverage instead of -Zprofile Support for -Zprofile has been removed: https://github.com/rust-lang/rust/pull/131829 --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6231caf..a065c651 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,11 +103,17 @@ jobs: - name: Checkout source code uses: actions/checkout@v4 + - name: Initialize workflow + shell: bash + run: | + mkdir -p ./target/coverage + - name: Install `rust` toolchain run: | ## Install `rust` toolchain rustup toolchain install nightly --no-self-update -c rustfmt --profile minimal rustup default nightly + rustup component add llvm-tools-preview - name: "`grcov` ~ install" run: cargo install grcov @@ -115,15 +121,18 @@ jobs: - name: cargo test run: | cargo test --all --no-fail-fast ${{ matrix.cargo_flags }} + working-directory: target/debug env: CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off" - RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off" + 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" + 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" + LLVM_PROFILE_FILE: "./target/coverage/find-%p-%m.profraw" - name: Generate coverage data id: grcov run: | grcov target/debug/ \ + --binary-path=target/debug/ \ --branch \ --llvm \ --source-dir . \