diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6231ca..a7bbee6 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 ${{ vars.RUNNER_TEMP }}/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 @@ -117,13 +123,15 @@ jobs: cargo test --all --no-fail-fast ${{ matrix.cargo_flags }} 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: ${{ vars.RUNNER_TEMP }}"/find-%p-%m.profraw" - name: Generate coverage data id: grcov run: | grcov target/debug/ \ + --binary-path=target/debug/ \ --branch \ --llvm \ --source-dir . \