Skip to content

Commit cb27de8

Browse files
Initial release v0.0.1: CodeAnt AI Coverage Upload Action
0 parents  commit cb27de8

File tree

4 files changed

+496
-0
lines changed

4 files changed

+496
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 CodeAnt AI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# CodeAnt AI Coverage Upload Action
2+
3+
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-CodeAnt%20AI%20Coverage-blue.svg)](https://github.com/marketplace/actions/codeant-ai-coverage-upload)
4+
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5+
6+
Upload test coverage reports to CodeAnt AI for comprehensive analysis, visualization, and tracking of your code coverage metrics.
7+
8+
## Features
9+
10+
- 📊 Upload coverage reports in multiple formats (XML, JSON, LCOV, etc.)
11+
- 🔍 Automatic coverage analysis and insights
12+
- 📈 Track coverage trends over time
13+
- 🎯 Integration with pull requests
14+
- 🚀 Easy setup with minimal configuration
15+
16+
## Usage
17+
18+
### Basic Example
19+
20+
```yaml
21+
name: Test Coverage
22+
23+
on:
24+
push:
25+
branches: [main]
26+
pull_request:
27+
branches: [main]
28+
29+
jobs:
30+
coverage:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Run tests with coverage
37+
run: |
38+
# Your test command that generates coverage report
39+
pytest --cov --cov-report=xml
40+
41+
- name: Upload coverage to CodeAnt AI
42+
uses: CodeAnt-AI/[email protected]
43+
with:
44+
access_token: ${{ secrets.CODEANT_ACCESS_TOKEN }}
45+
coverage_file: coverage.xml
46+
```
47+
48+
### Advanced Example
49+
50+
```yaml
51+
- name: Upload coverage to CodeAnt AI
52+
uses: CodeAnt-AI/[email protected]
53+
with:
54+
access_token: ${{ secrets.CODEANT_ACCESS_TOKEN }}
55+
coverage_file: coverage.json
56+
api_base: https://api.codeant.ai
57+
platform: github
58+
base_url: https://github.com
59+
```
60+
61+
## Inputs
62+
63+
| Input | Description | Required | Default |
64+
|-------|-------------|----------|---------|
65+
| `access_token` | GitHub Access Token for authentication | Yes | - |
66+
| `coverage_file` | Path to the coverage file (e.g., coverage.xml, coverage.json) | Yes | `coverage.xml` |
67+
| `api_base` | CodeAnt AI API base URL | No | `https://api.codeant.ai` |
68+
| `platform` | Git platform (github, gitlab, bitbucket) | No | `github` |
69+
| `base_url` | Base URL of the git platform | No | `https://github.com` |
70+
71+
## Supported Coverage Formats
72+
73+
- Cobertura XML (`.xml`)
74+
- JaCoCo XML
75+
- LCOV (`.lcov`)
76+
- JSON coverage reports
77+
- And more...
78+
79+
## Setup
80+
81+
### 1. Generate Coverage Report
82+
83+
First, ensure your test suite generates a coverage report. Here are examples for common languages:
84+
85+
#### Python (pytest)
86+
```bash
87+
pytest --cov --cov-report=xml
88+
```
89+
90+
#### JavaScript/TypeScript (Jest)
91+
```bash
92+
jest --coverage --coverageReporters=cobertura
93+
```
94+
95+
#### Java (Maven)
96+
```bash
97+
mvn test jacoco:report
98+
```
99+
100+
#### Go
101+
```bash
102+
go test -coverprofile=coverage.out ./...
103+
gocov convert coverage.out | gocov-xml > coverage.xml
104+
```
105+
106+
### 2. Add Secrets
107+
108+
Add your CodeAnt AI access token to your repository secrets:
109+
1. Go to your repository Settings
110+
2. Navigate to Secrets and variables → Actions
111+
3. Click "New repository secret"
112+
4. Name: `CODEANT_ACCESS_TOKEN`
113+
5. Value: Your CodeAnt AI access token
114+
115+
### 3. Configure Workflow
116+
117+
Add the action to your GitHub Actions workflow as shown in the usage examples above.
118+
119+
## How It Works
120+
121+
1. The action fetches the latest coverage upload script from CodeAnt AI
122+
2. Decodes and prepares the script for execution
123+
3. Uploads your coverage report along with commit and branch information
124+
4. CodeAnt AI processes the report and provides analysis
125+
126+
## Troubleshooting
127+
128+
### Coverage file not found
129+
Ensure the `coverage_file` path is correct and the file exists before running this action.
130+
131+
### Authentication failed
132+
Verify that your `CODEANT_ACCESS_TOKEN` is valid and has the necessary permissions.
133+
134+
### Script execution failed
135+
Check that the CodeAnt AI API is accessible from your runner environment.
136+
137+
## Contributing
138+
139+
Contributions are welcome! Please feel free to submit a Pull Request.
140+
141+
## License
142+
143+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
144+
145+
## Support
146+
147+
- 📧 Email: [email protected]
148+
- 📚 Documentation: https://docs.codeant.ai
149+
- 🐛 Issues: https://github.com/CodeAnt-AI/codeant-coverage-action/issues
150+
151+
## Related
152+
153+
- [CodeAnt AI](https://codeant.ai) - AI-powered code analysis platform
154+
- [GitHub Actions Documentation](https://docs.github.com/en/actions)

0 commit comments

Comments
 (0)