Skip to content

ci: Rust coverage gate (cargo-llvm-cov 80%) + vitest scope fix + codecov#42

Merged
ignromanov merged 2 commits into
mainfrom
056-phase3-a5-rust-coverage
Jun 4, 2026
Merged

ci: Rust coverage gate (cargo-llvm-cov 80%) + vitest scope fix + codecov#42
ignromanov merged 2 commits into
mainfrom
056-phase3-a5-rust-coverage

Conversation

@ignromanov
Copy link
Copy Markdown
Contributor

Closes #17 (re-audit last item A5).

Changes

1. Rust coverage gate (lint-and-build job)

  • Adds components: llvm-tools-preview to the existing actions-rust-lang/setup-rust-toolchain step.
  • Installs cargo-llvm-cov via taiki-e/install-action@25435dc8dd3baed7417e0c96d3fe89013a5b2e09 (v2.81.3, pinned SHA).
  • Replaces plain cargo test in lint-and-build with cargo llvm-cov --fail-under-lines 80 --lcov --output-path rust-lcov.info. CI fails if Rust line coverage drops below 80% (Constitution X). Other jobs (macos-sanity, vector-parity) keep plain cargo test.

2. Vitest coverage scope fix

  • Narrows coverage.include from src/** to src/**/*.ts in packages/codec/vitest.config.ts.
  • Eliminates "Failed to parse *.rs" warnings from @vitest/coverage-v8 (cosmetic noise introduced in the TS6/vitest4 wave).
  • Adds reporter: ['text', 'lcov'] so packages/codec/coverage/lcov.info is emitted for codecov.

3. Codecov upload (non-blocking)

  • Adds codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 (v6.0.1, pinned SHA) after coverage runs.
  • Uploads both rust-lcov.info (flag: rust) and packages/codec/coverage/lcov.info (flag: ts).
  • fail_ci_if_error: false — a codecov outage must not break CI.
  • Adds minimal codecov.yml at repo root: Rust patch/project status is informational (advisory only); TS flag uses default (blocking on threshold regression).

Measurements

  • Rust line coverage: 91.95% (gate is 80% — 11.95 pp headroom)
  • TS coverage: 98.24% stmts / 90% branches / 100% funcs / 100% lines (all above 80%)
  • .rs parse warnings: gone (confirmed locally)

Pinned action SHAs

Action SHA Tag
taiki-e/install-action 25435dc8dd3baed7417e0c96d3fe89013a5b2e09 v2.81.3
codecov/codecov-action e79a6962e0d4c0c17b229090214935d2e33f8354 v6.0.1

Eliminates "Failed to parse *.rs" warnings from @vitest/coverage-v8
when scanning src/ for uncovered files. Rust sources were never real
TS coverage targets; narrowing the glob has no effect on coverage %.

Adds reporter: ['text', 'lcov'] so lcov.info is emitted for codecov
upload (change 3 of A5 task).
- Add llvm-tools-preview component to setup-rust-toolchain in
  lint-and-build job so cargo-llvm-cov instrumentation is available.
- Install cargo-llvm-cov via taiki-e/install-action (pinned SHA v2.81.3).
- Replace plain `cargo test` in lint-and-build with
  `cargo llvm-cov --fail-under-lines 80` (Constitution X gate).
  Other jobs (macos-sanity, vector-parity) keep plain cargo test.
- Add codecov/codecov-action upload (pinned SHA v6.0.1) for both
  rust-lcov.info (flag: rust) and packages/codec/coverage/lcov.info
  (flag: ts). fail_ci_if_error: false — codecov hiccup must not break CI.
- Add minimal codecov.yml: rust flag is informational (advisory),
  ts flag is default (blocking on threshold regression).

Measured Rust line coverage: 91.95% (gate: 80%).
@ignromanov ignromanov merged commit e7efce5 into main Jun 4, 2026
7 checks passed
@ignromanov ignromanov deleted the 056-phase3-a5-rust-coverage branch June 4, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[codec][P0] Publish-blockers: Node-runnable artifact + networks barrel + release.yml + Rust coverage

1 participant