CI/CD Automation
Integrate code coverage into your continuous integration pipeline to catch regressions and track coverage trends.
Typical CI Workflow
Build Tests → Run covdbg → Export LCOV → Upload/Store Artifacts
- Build your tests with debug symbols (PDBs)
- Run tests under covdbg to produce
.covdb - Export to LCOV/GCOV for downstream tooling
- Upload to coverage services or store as artifacts
Quick Example
# 1. Run tests with coverage
covdbg --output coverage.covdb tests.exe
# 2. Export to LCOV
covdbg convert -i coverage.covdb -f LCOV -o coverage.lcov
# 3. Upload to coverage service (example)
codecov --file coverage.lcov
Environment Setup
A pipeline has nobody to sign in, so it carries a project token:
$env:COVDBG_PROJECT_TOKEN = "<your-project-token>"
Store COVDBG_PROJECT_TOKEN as an encrypted secret in your CI system.
Open Source? Public repositories are free; the pipeline still carries a project token, which is what names who is asking. See Open Source for details.
Clean Output
covdbg leaves the console to your test results and only adds its own errors there; its log goes to a file. Use --log-level NONE to switch the log file off:
covdbg --log-level NONE --output coverage.covdb tests.exe
Merging Multiple Test Runs
If you have multiple test executables or parallel test jobs:
# Run each test suite
covdbg --output unit.covdb unit_tests.exe
covdbg --output integration.covdb integration_tests.exe
# Merge results
covdbg merge -i unit.covdb -i integration.covdb -o merged.covdb
# Export merged coverage
covdbg convert -i merged.covdb -f LCOV -o coverage.lcov
Why Automate Coverage
| Benefit | Description |
|---|---|
| Catch regressions | Fail builds when coverage drops |
| Track trends | Monitor coverage over time |
| Enforce standards | Set minimum coverage thresholds |
| Document quality | Show coverage badges in README |
Best Practices
- Run on every PR - Get coverage feedback before merge
- Use consistent filters - Keep
.covdbg.yamlin version control - Store artifacts - Save
.covdband exports for debugging - Fail on threshold - Set minimum coverage requirements
Platform-Specific Guides
- GitHub Actions - Complete workflow examples
See Also
- CLI Reference - Command documentation
- Configuration - Filter setup
- Report Formats - Export formats