Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orgoro/coverage
GitHub Action for python coverage publish & analysis
https://github.com/orgoro/coverage
action coverage github-actions python typescript
Last synced: about 18 hours ago
JSON representation
GitHub Action for python coverage publish & analysis
- Host: GitHub
- URL: https://github.com/orgoro/coverage
- Owner: orgoro
- License: mit
- Created: 2021-10-03T19:44:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-17T08:41:42.000Z (3 months ago)
- Last Synced: 2025-01-01T06:04:20.309Z (8 days ago)
- Topics: action, coverage, github-actions, python, typescript
- Language: TypeScript
- Homepage:
- Size: 810 KB
- Stars: 112
- Watchers: 2
- Forks: 32
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Python Coverage: The Esential Coverage Reporter GitHub Action for python
> ☂️ parse and publish coverage xml to a PR, enforce coverage rate on new & modified files
## Usage
Create a new workflow `.yml` file in the `.github/workflows/` directory.
You can create a coverage report using python:
- pytest `$ pytest --cov-report xml:path/to/coverage.xml`
- coverage `$ coverage xml path/to/coverage.xml`### Minimal Configuration
```yml
name: 'coverage'
on:
pull_request:
branches:
- master
- main
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Get Cover
uses: orgoro/[email protected]
with:
coverageFile: path/to/coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
```
## PR Message & Job Summary 🆕![message](./images/pr-message.png)
## Inputs
| Input | Optional | Description | Example |
|---------------------|-----------|--------------------------------------------------|------------------------|
| `coverageFile` | | path to .xml coverage report | ./path/to/coverage.xml |
| `token` | | your github token | 🤫 |
| `thresholdAll` | ✅ | the minimal average line coverage | 0.8 |
| `thresholdNew` | ✅ | the minimal average new files line coverage | 0.9 |
| `thresholdModified` | ✅ | the minimal average modified files line coverage | 0.0 |
| `passIcon` | ✅ | the indicator to use for files that passed | 🟢 |
| `failIcon` | ✅ | the indicator to use for files that failed | 🔴 |
| `sourceDir` | ✅ | the indicator to use for files that failed | ./path/to/src |