From 37a92e27a20d78cb28d487350d9b3795d03ac914 Mon Sep 17 00:00:00 2001 From: Nichokas Date: Mon, 7 Apr 2025 18:50:12 +0200 Subject: [PATCH 1/2] Fix coverage.yml --- .github/workflows/coverage.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index da0dce7..450a858 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,8 +15,9 @@ jobs: runs-on: ubuntu-latest env: CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" - RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" + RUSTFLAGS: "-C instrument-coverage -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Zpanic_abort_tests" + RUSTDOCFLAGS: "-C instrument-coverage -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Zpanic_abort_tests" + LLVM_PROFILE_FILE: "coverage-%p-%m.profraw" steps: # Checkout the repository @@ -50,12 +51,19 @@ jobs: args: "--workspace" # Install grcov - - uses: actions-rs/grcov@v0.1 - id: coverage + - name: Install grcov + run: cargo install grcov --force + + - name: Generate lcov report + run: | + grcov . \ + --ignore-not-existing \ + -o lcov.info + # Upload to Codecov.io - name: Upload to Codecov.io uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - file: ${{ steps.coverage.outputs.report }} \ No newline at end of file + file: lcov.info From e78420c74e2de2b701d51ec348ddc3f0202b81f1 Mon Sep 17 00:00:00 2001 From: Nichokas Date: Mon, 7 Apr 2025 18:55:44 +0200 Subject: [PATCH 2/2] Improve coverage.yml Removed archived dependencies (actions-rs) --- .github/workflows/coverage.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 450a858..153316c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,13 +24,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # Setup Rust nightly + # Setup Rust nightly - name: Install Rust - uses: actions-rs/toolchain@v1 - id: toolchain + uses: hecrj/setup-rust-action@v1 with: - toolchain: nightly - override: true + rust-version: nightly # Configure cache for Cargo - name: Cache Cargo registry, index @@ -45,10 +43,7 @@ jobs: # Run tests with all features - name: Test (cargo test) - uses: actions-rs/cargo@v1 - with: - command: test - args: "--workspace" + run: cargo test --workspace # Install grcov - name: Install grcov