CodeAnt AI Coverage Upload Action
Upload test coverage reports to CodeAnt AI for comprehensive analysis, visualization, and tracking of your code coverage metrics. You can find this action on the GitHub Marketplace.Features
- 📊 Upload coverage reports in multiple formats (XML, JSON, LCOV, etc.)
- 🔍 Automatic coverage analysis and insights
- 📈 Track coverage trends over time
- 🎯 Integration with pull requests
- 🚀 Easy setup with minimal configuration
Usage
Basic Example
Advanced Example
Inputs
Input | Description | Required | Default |
---|---|---|---|
access_token | GitHub Access Token for authentication | Yes | - |
coverage_file | Path to the coverage file (e.g., coverage.xml, coverage.json) | Yes | coverage.xml |
api_base | CodeAnt AI API base URL | No | https://api.codeant.ai |
platform | Git platform (github, gitlab, bitbucket) | No | github |
base_url | Base URL of the git platform | No | https://github.com |
Supported Coverage Formats
- Cobertura XML (.xml)
- JaCoCo XML
- LCOV (.lcov)
- JSON coverage reports
- And more…
Setup
1. Generate Coverage Report
First, ensure your test suite generates a coverage report. Here are examples for common languages: Python (pytest)2. Add Secrets
Add your CodeAnt AI access token to your repository secrets:- Go to your repository Settings
- Navigate to Secrets and variables → Actions
- Click “New repository secret”
- Name:
GITHUB_ACCESS_TOKEN
- Value: Your CodeAnt AI access token
3. Configure Workflow
Add the action to your GitHub Actions workflow as shown in the usage examples above.Token Permissions
The access token requires the following permissions:- Metadata: Read-only access
- Commit statuses: Read and write access

Coverage config file
You have to create a .coveragerc file in the project’s root folder to include all the source files in the test coverage calculation. Example:How it works
With the above configuration:- coverage run -m pytest tests/ will count every .py under the workspace as “valid” lines except for those in the omitted directories.
- Lines actually executed by your tests are marked “covered.”
- coverage xml -o coverage.xml produces a Cobertura-style report reflecting true coverage over the entire codebase.
- Using this coverage xml, we calculate the coverage percentage and the status check will be done on every new push to the branch.