From 692b881db7f81960270bf5b93ec1c5bbbe677805 Mon Sep 17 00:00:00 2001 From: Leynos Date: Sat, 5 Jul 2025 14:47:27 +0100 Subject: [PATCH 1/3] Switch coverage to shared actions --- .github/workflows/ci.yml | 23 +++++++++-------------- docs/multi-layered-testing-strategy.md | 10 ++++++---- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 206e298f..d2b2ad69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,23 +40,18 @@ jobs: run: cargo clippy --all-targets --all-features -- -D warnings - name: Test run: cargo test - - name: Install cargo-tarpaulin - run: cargo install cargo-tarpaulin - name: Run coverage - run: cargo tarpaulin --out lcov - - name: Install CodeScene coverage tool - if: env.CS_ACCESS_TOKEN - run: | - set -euo pipefail - curl -fsSL -o install-cs-coverage-tool.sh https://downloads.codescene.io/enterprise/cli/install-cs-coverage-tool.sh - if [ -n "${CODESCENE_CLI_SHA256:-}" ]; then - echo "${CODESCENE_CLI_SHA256} install-cs-coverage-tool.sh" | sha256sum -c - - fi - bash install-cs-coverage-tool.sh -y - rm install-cs-coverage-tool.sh + id: coverage + uses: leynos/shared-actions/.github/actions/ratchet-coverage@v1.2.0 + with: + args: --workspace --lcov --output-path lcov.info - name: Upload coverage data to CodeScene if: env.CS_ACCESS_TOKEN - run: cs-coverage upload --format "lcov" --metric "line-coverage" "lcov.info" + uses: leynos/shared-actions/.github/actions/upload-codescene-coverage@v1.2.0 + with: + format: lcov + access-token: ${{ env.CS_ACCESS_TOKEN }} + installer-checksum: ${{ env.CODESCENE_CLI_SHA256 }} - name: Upload coverage data to Codecov # v5.4.3 uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 diff --git a/docs/multi-layered-testing-strategy.md b/docs/multi-layered-testing-strategy.md index d4f0c0a4..c4c3ed50 100644 --- a/docs/multi-layered-testing-strategy.md +++ b/docs/multi-layered-testing-strategy.md @@ -15,10 +15,12 @@ reviewers. This approach ensures that we establish a baseline of correctness with simple tests before moving on to the more complex and subtle failure modes that can emerge in an asynchronous, high-concurrency system. -Code coverage is measured with `cargo tarpaulin`. The CI workflow uploads the -generated `lcov.info` report to Codecov using a pinned version of the Codecov -GitHub Action (`18283e04ce6e62d37312384ff67231eb8fd56d24`, corresponding to -v5.4.3) to make coverage visible across pull requests. +Code coverage is measured with `cargo llvm-cov`. The workflow uses the +`ratchet-coverage` action to fail if coverage drops, and uploads the resulting +`lcov.info` to Codecov using a pinned version of the Codecov GitHub Action +(`18283e04ce6e62d37312384ff67231eb8fd56d24`, corresponding to v5.4.3). The same +report is also sent to CodeScene via the `upload-codescene-coverage@v1.2.0` +action. ## 2. Layer 1: Foundational Correctness (Unit & Integration) From 7caa7e32f1d9895e972f857000c23055cb233349 Mon Sep 17 00:00:00 2001 From: Leynos Date: Sat, 5 Jul 2025 15:27:29 +0100 Subject: [PATCH 2/3] Clarify coverage tool --- docs/multi-layered-testing-strategy.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/multi-layered-testing-strategy.md b/docs/multi-layered-testing-strategy.md index c4c3ed50..f20eb1c5 100644 --- a/docs/multi-layered-testing-strategy.md +++ b/docs/multi-layered-testing-strategy.md @@ -15,12 +15,12 @@ reviewers. This approach ensures that we establish a baseline of correctness with simple tests before moving on to the more complex and subtle failure modes that can emerge in an asynchronous, high-concurrency system. -Code coverage is measured with `cargo llvm-cov`. The workflow uses the -`ratchet-coverage` action to fail if coverage drops, and uploads the resulting -`lcov.info` to Codecov using a pinned version of the Codecov GitHub Action -(`18283e04ce6e62d37312384ff67231eb8fd56d24`, corresponding to v5.4.3). The same -report is also sent to CodeScene via the `upload-codescene-coverage@v1.2.0` -action. +Code coverage is measured with `cargo llvm-cov`. The `ratchet-coverage` action +builds on this tool—not `cargo-tarpaulin`—and fails if coverage drops. The +resulting `lcov.info` is uploaded to Codecov using a pinned version of the +Codecov GitHub Action (`18283e04ce6e62d37312384ff67231eb8fd56d24`, corresponding +to v5.4.3). The same report is also sent to CodeScene via the +`upload-codescene-coverage@v1.2.0` action. ## 2. Layer 1: Foundational Correctness (Unit & Integration) From 0011c8e88a352ae45809386cb4db8eeea1a57b70 Mon Sep 17 00:00:00 2001 From: Leynos Date: Sat, 5 Jul 2025 17:32:25 +0100 Subject: [PATCH 3/3] Use action v1.2.1 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2b2ad69..99872f3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,12 +42,12 @@ jobs: run: cargo test - name: Run coverage id: coverage - uses: leynos/shared-actions/.github/actions/ratchet-coverage@v1.2.0 + uses: leynos/shared-actions/.github/actions/ratchet-coverage@v1.2.1 with: args: --workspace --lcov --output-path lcov.info - name: Upload coverage data to CodeScene if: env.CS_ACCESS_TOKEN - uses: leynos/shared-actions/.github/actions/upload-codescene-coverage@v1.2.0 + uses: leynos/shared-actions/.github/actions/upload-codescene-coverage@v1.2.1 with: format: lcov access-token: ${{ env.CS_ACCESS_TOKEN }}