CI Integration / Uploader
Integrating code coverage reporting into your CI pipeline ensures that coverage data is consistently collected and reported for every build.
Qlty is compatible with every major CI provider, and offers specific workflow support for GitHub (via a GitHub Action) and Circle CI (via an Orb).
CI Provider Integration
GitHub Actions
Use Qlty’s official GitHub Action for the simplest integration.
Using OIDC (Recommended)
Using a Coverage Token
CircleCI
Qlty offers a CircleCI Orb for easy integration.
Using the Orb
Add the Qlty orb to your .circleci/config.yml
:
Manual Integration
If you prefer not to use the orb:
Travis CI
Add Qlty coverage reporting to your .travis.yml
:
Make sure to add your QLTY_COVERAGE_TOKEN
in the Travis CI repository settings.
GitLab CI
Add coverage reporting to your .gitlab-ci.yml
:
Add your QLTY_COVERAGE_TOKEN
as a CI/CD variable in your GitLab project settings.
Buildkite
Add the following steps to your pipeline.yml
:
Advanced CI Configuration
Parallelized Tests
When running tests in parallel, you’ll need to merge the coverage reports before uploading. Qlty supports both client-side and server-side merging.
Client-side Merging
Collect all coverage reports into a single location and upload them together:
Server-side Merging
Upload each part separately and specify the total number of parts:
Learn more about Coverage Merging.
Multiple Test Suites
If you have different types of tests (unit, integration, e2e), you can track them separately using coverage tags:
Learn more about Coverage Tags.
Path Fixing
If your coverage report contains absolute paths or paths that don’t match your repository structure:
Learn more about Path Fixing.
Branch and Commit Detection
Qlty automatically detects branch names and commit SHAs from CI environment variables. If automatic detection fails, you can specify them manually:
CI Provider Detection
Qlty automatically detects and extracts metadata from these CI providers:
- GitHub Actions
- CircleCI
- Travis CI
- GitLab CI
- Buildkite
- Codefresh
- Semaphore
If your CI provider is not listed above, double check our Qlty repository to see if an implementation has been added recently (and let us know so we can update our docs).
If your CI provider is not support, you’ll need to manually provide the following required arguments to qlty coverage publish
:
--override-branch
--override-commit
--override-build-id
Troubleshooting
Common Issues
- Authentication failures: Check that your token is correctly set as an environment variable
- Report format not recognized: Make sure you’re using a supported coverage format
- Path mismatches: Use the
--strip-prefix
and--add-prefix
options to fix file paths - Missing metadata: Use
--override-branch
,--override-commit
and--override-build-id
if CI detection fails
Debug Mode
To get more information about what’s happening during upload:
See Also
- Coverage Merging - Combine multiple coverage reports
- Coverage Tags - Track different test suites separately
- Supported CI Providers - Details on CI-specific integrations