Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

16 Commits

Repository files navigation

CodeAnt AI Coverage Upload Action

GitHub MarketplaceLicense

Upload test coverage reports to CodeAnt AI for comprehensive analysis, visualization, and tracking of your code coverage metrics.

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

name: Test Coverageon:
push:
branches: [main]pull_request:
branches: [main]jobs:
coverage:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- name: Run tests with coveragerun: | # Your test command that generates coverage report pytest --cov --cov-report=xml - name: Upload coverage to CodeAnt AIuses: CodeAnt-AI/codeant-coverage-action@v0.0.6with:
access_token: ${{ secrets.ACCESS_TOKEN_GITHUB }}coverage_file: coverage.xml

Advanced Example

- name: Upload coverage to CodeAnt AIuses: CodeAnt-AI/codeant-coverage-action@v0.0.6with:
access_token: ${{ secrets.ACCESS_TOKEN_GITHUB }}coverage_file: coverage.jsonapi_base: https://api.codeant.aiplatform: githubbase_url: https://github.commodule: backend # Optional: for monorepo setupsmodule_path: services/backend # Optional: path for resolving files in monorepo

Inputs

InputDescriptionRequiredDefault
access_tokenGitHub Access Token for authenticationYes-
coverage_filePath to the coverage file (e.g., coverage.xml, coverage.json)Yescoverage.xml
api_baseCodeAnt AI API base URLNohttps://api.codeant.ai
platformGit platform (github, gitlab, bitbucket)Nogithub
base_urlBase URL of the git platformNohttps://github.com
moduleModule name for monorepo setups (optional)No''
module_pathModule path for resolving files in monorepo (e.g., services/backend, defaults to module if not provided)No''

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)

pytest --cov --cov-report=xml

JavaScript/TypeScript (Jest)

jest --coverage --coverageReporters=cobertura

Java (Maven)

mvn test jacoco:report

Go

go test -coverprofile=coverage.out ./...
gocov convert coverage.out | gocov-xml > coverage.xml

2. Add Secrets

Add your CodeAnt AI access token to your repository secrets:

  1. Go to your repository Settings
  2. Navigate to Secrets and variables → Actions
  3. Click "New repository secret"
  4. Name: ACCESS_TOKEN_GITHUB
  5. Value: Your CodeAnt AI access token

3. Configure Workflow

Add the action to your GitHub Actions workflow as shown in the usage examples above.

How It Works

  1. The action fetches the latest coverage upload script from CodeAnt AI
  2. Decodes and prepares the script for execution
  3. Uploads your coverage report along with commit and branch information
  4. CodeAnt AI processes the report and provides analysis

Troubleshooting

Coverage file not found

Ensure the coverage_file path is correct and the file exists before running this action.

Authentication failed

Verify that your ACCESS_TOKEN_GITHUB is valid and has the necessary permissions.

Script execution failed

Check that the CodeAnt AI API is accessible from your runner environment.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Related

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors