Merge pull request #381 from ai-2070/renovate/redis-1.x-lockfile #806
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Coverage | |
| # Stage 2.5 of PANIC_AUDIT_AND_LINT_HARDENING_PLAN.md — generate | |
| # source-based line / region coverage with cargo-llvm-cov and | |
| # upload to Codecov for the PR-comment + dashboard surface. | |
| # | |
| # Crucially this is an **information-only** workflow, not a gate. | |
| # `codecov.yml` at the repo root pins every Codecov status to | |
| # `informational: true` so a coverage drop never blocks a merge. | |
| # The plan and the project's existing TEST_COVERAGE_PLAN.md both | |
| # explicitly reject percentage targets ("reward testing trivial | |
| # getters"); the data is useful for spot-checking new code, not | |
| # for gating. | |
| # | |
| # Triggers: | |
| # - push to master -> updates the baseline Codecov tracks | |
| # - pull_request -> computes patch + project deltas for the PR | |
| # | |
| # The workflow caches the cargo build directory like the rest of | |
| # CI; the coverage instrumentation rebuilds with `-C | |
| # instrument-coverage` so the cache key is segregated to avoid | |
| # poisoning the main cargo cache. | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'net/**' | |
| - 'go/**' | |
| - '.github/workflows/coverage.yml' | |
| pull_request: | |
| paths: | |
| - 'net/**' | |
| - 'go/**' | |
| - '.github/workflows/coverage.yml' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| coverage: | |
| name: Coverage (cargo-llvm-cov) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: net/crates/net | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # The rust-toolchain.toml in net/crates/net pins | |
| # `llvm-tools-preview` as a required component, which provides | |
| # the `llvm-profdata` / `llvm-cov` binaries cargo-llvm-cov | |
| # invokes. Using dtolnay/rust-toolchain@stable picks up | |
| # whatever the toolchain file specifies, so no separate | |
| # components arg here. | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| # Separate cache key from the main CI clippy/test jobs so the | |
| # coverage-instrumented build artifacts (which embed source- | |
| # location maps from `-C instrument-coverage`) don't poison | |
| # the cache the main jobs depend on. | |
| - name: Cache cargo | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| net/crates/net/target/ | |
| key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-llvm-cov | |
| # `--features` mirrors the clippy job's feature set — | |
| # broad enough to compile every test in `tests/*.rs` that | |
| # isn't gated on a service-container feature (redis, | |
| # jetstream). Dropping `--lib` lets cargo-llvm-cov pick up | |
| # both the in-source `#[cfg(test)]` units and the | |
| # integration tests in `tests/`, which is where the bulk of | |
| # the substrate's behavioral coverage actually lives | |
| # (channel auth, three-node mesh, CortEX nRPC, NetDB, | |
| # MeshOS / Deck pipelines, dataforts blob storage, | |
| # AI tool serve/announce/dispatch…). | |
| # `--no-fail-fast` matches the main `integration-tests` job | |
| # so a flake in one test doesn't drop coverage from the | |
| # rest. FFI shims / bindings / benches / examples are | |
| # excluded in codecov.yml. | |
| # | |
| # `tool` opts in `integration_tool_announce` (the substrate- | |
| # side serve_tool + announce-merge + tool.metadata.fetch | |
| # contract pin) and the tool-aware paths in the | |
| # capability/fold layer — without it the AI tool surface | |
| # contributes 0% to the substrate coverage line. | |
| - name: Generate coverage (lcov) | |
| run: > | |
| cargo llvm-cov | |
| --features "net redex cortex netdb meshos dataforts nat-traversal port-mapping tool" | |
| --no-fail-fast | |
| --lcov | |
| --output-path coverage.lcov | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| files: net/crates/net/coverage.lcov | |
| # `fail_ci_if_error: false` keeps the workflow advisory | |
| # — a Codecov-side outage / token issue must never block | |
| # a merge. | |
| fail_ci_if_error: false | |
| # `token: ${{ secrets.CODECOV_TOKEN }}` is required for | |
| # private repos and recommended for public ones (tokenless | |
| # uploads from forks fail intermittently in mid-2026). | |
| # Configure the secret at: | |
| # Settings -> Secrets and variables -> Actions | |
| # -> New repository secret -> CODECOV_TOKEN | |
| # The value comes from codecov.io/gh/<org>/<repo>/settings. | |
| token: ${{ secrets.CODECOV_TOKEN }} |