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 |
module | Module name for monorepo setups | No | - |
module_path | Module path for resolving files in monorepo | No | - |
Supported Coverage Formats
- Cobertura XML (.xml)
- JaCoCo XML
- LCOV (.lcov)
- JSON coverage reports
- And more…
Setup
1. Get Your GitHub Access Token
- Log in to your GitHub account
- Go to Settings > Developer settings > Personal access tokens > Tokens (classic)
- Click Generate new token (classic)
- Select the
reposcope - Generate and copy the token
2. Generate Coverage Report
First, ensure your test suite generates a coverage report. Here are examples for common languages: Python (pytest)3. Add Secrets
Add your GitHub Access Token to your repository secrets (after generating it via Settings → Developer settings → Personal access tokens):- Go to your repository Settings
- Navigate to Secrets and variables → Actions
- Click “New repository secret”
- Name:
ACCESS_TOKEN_GITHUB - Value: Your GitHub Access Token
4. 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.