Commit bc594cc
committed
ci(coverage): Add cargo-tarpaulin code coverage to CI workflow
Add automated code coverage generation and reporting to Codecov using
cargo-tarpaulin. This enhances CI/CD pipeline with continuous coverage
monitoring on every push and pull request.
**Changes:**
1. Added cargo-tarpaulin Installation Step
- Linux/macOS only (Windows excluded due to limited test coverage)
- Installs latest tarpaulin via 'cargo install'
- Conditional execution: matrix.os != 'windows-latest'
2. Added Coverage Generation Step
- Command: cargo tarpaulin --workspace --locked --lib --bins --tests
- Excludes: prtip-network, prtip-scanner (consistent with test strategy)
- Output: Cobertura XML format in ./coverage/ directory
- Timeout: 300 seconds (5 minutes) to prevent CI hangs
- Environment: PRTIP_DISABLE_HISTORY=1 (prevents test race conditions)
3. Updated Codecov Upload Action
- Changed: codecov/test-results-action@v1 → codecov/codecov-action@v4
- Reason: test-results-action expects JUnit XML (test results),
codecov-action@v4 expects Cobertura XML (coverage data)
- File path: ./coverage/cobertura.xml (explicit for reliability)
- fail_ci_if_error: false (don't block CI on coverage upload failures)
- verbose: true (detailed logging for troubleshooting)
- Conditional: matrix.os != 'windows-latest' && !cancelled()
**Technical Details:**
- Tarpaulin generates Cobertura XML (coverage %), not JUnit XML (test results)
- Previous action (test-results-action) expected wrong format
- New action (codecov-action@v4) correctly handles coverage data
- Coverage scope matches existing test execution strategy
- Linux/macOS only (tarpaulin compatibility)
**Impact:**
- ✅ Automated coverage reporting on every CI run
- ✅ Codecov integration for coverage tracking and visualization
- ✅ Maintains all existing CI workflows (7/7 jobs)
- ✅ Zero impact on test execution (coverage runs after tests)
- ✅ No breaking changes to existing infrastructure
**Files Modified:**
- .github/workflows/ci.yml: +18 lines (3 new steps, 1 modified)
- CHANGELOG.md: +12 lines (Changed section entry)
**Verification:**
- Workflow syntax: Valid YAML
- Conditionals: Properly formatted for GitHub Actions
- File paths: Explicit and correct
- Codecov action: Latest v4 with correct parameters
**Strategic Value:**
Establishes continuous coverage monitoring infrastructure for ProRT-IP.
Enables data-driven decisions for test coverage improvements and ensures
code quality metrics are tracked across all development phases.
Supports Phase 6 goals: Comprehensive testing, quality metrics, professional
development practices. Aligns with existing coverage reporting from Sprint 5.6
(54.92% baseline, automated CI tracking).
Related: Sprint 5.6 Coverage Enhancement (commit ed9c991)
See: CHANGELOG.md for complete Sprint 6.3 progress1 parent e760c45 commit bc594cc
2 files changed
+32
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
176 | 190 | | |
177 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
178 | 195 | | |
179 | 196 | | |
180 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
12 | 24 | | |
| |||
0 commit comments