From da6899f8b71ec3c1653e36987b14651d7c97d649 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Wed, 3 Sep 2025 12:16:13 +0200 Subject: [PATCH] ci: switch to codecov and llvm-cov --- .github/codecov.yml | 21 +++++++++++++++++++++ .github/workflows/ci.yml | 22 ++++++++++++++++------ 2 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..6d1fd66 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,21 @@ +codecov: + notify: + require_ci_to_pass: false + +coverage: + status: + project: + default: + target: auto + threshold: 5% + informational: true + patch: + default: + target: auto + threshold: 5% + informational: true + +comment: + layout: "reach,diff,flags,tree,betaprofiling" + behavior: default + require_changes: false \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 038f740..9fa2440 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: rust-version: - stable env: - HAS_COVERALLS_ACCESS: ${{ secrets.COVERALLS_REPO_TOKEN != '' }} + HAS_CODECOV_ACCESS: ${{ secrets.CODECOV_TOKEN != '' }} steps: - uses: actions/checkout@v4 with: @@ -57,8 +57,9 @@ jobs: toolchain: ${{ matrix.rust-version }} components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - - name: Install tarpaulin - run: cargo install cargo-tarpaulin + - name: Install cargo-llvm-cov + if: env.HAS_CODECOV_ACCESS == 'true' + run: cargo install cargo-llvm-cov - name: Test compilation run: cargo check --all --all-targets - name: Test formatting @@ -68,10 +69,19 @@ jobs: - name: Test documentation run: cargo doc --all --no-deps - name: Run tests with code coverage - if: ${{ env.HAS_COVERALLS_ACCESS == 'true' }} - run: cargo tarpaulin --release --engine llvm --follow-exec --post-test-delay 10 --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} + if: env.HAS_CODECOV_ACCESS == 'true' + run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json + - name: Upload coverage to Codecov + if: env.HAS_CODECOV_ACCESS == 'true' + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: MilesCranmer/rip2 + files: ./codecov.json + fail_ci_if_error: false + verbose: true - name: Run tests - if: ${{ env.HAS_COVERALLS_ACCESS != 'true' }} + if: env.HAS_CODECOV_ACCESS != 'true' run: cargo test --all nix: