jotafan/pycoverage
Check pytest coverage and fail if tests failed or file and/or total coverage below threshold.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stalelast commit Nov 20, 2024
- License
- MIT
Pinned Snippet
uses: jotafan/pycoverage@4cbb8fff56cf974eabdcd0cf3d690acbc4e1efec # v1.1.1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| requirements-file | Path to the requirements file if you use pip. ./requirements.txt by default | no | ./requirements.txt |
| pytest-root-dir | root directory to recursively search for .py files | no | . |
| pytest-tests-dir | directory with pytest tests. if left empty will identify test(s) dir by default | no | ./ |
| cov-omit-list | list of directories and/or files to ignore | no | "" |
| cov-threshold-single | fail if any single file coverage is less than threshold | no | 0 |
| cov-threshold-total | fail if the total coverage is less than threshold | no | 0 |
| async-tests | Add support for async tests | no | false |
| poetry-groups | Poetry group names with the dependencies for the tests. | no | dev,tests |
| package-extras | Package extras with the dependencies for the tests, or dev-requirement file if pip | no | dev,tests |
| output | Output path to write the coverage badge. | no | badges/coverage.svg |
| overwrite | Overwrite an existing coverage badge. | no | true |
| github_token | GitHub writing token | no | "" |
| working_branch | Working branch | no | main |
| commit_badge | Boolean to either make a commit on the coverage badge or not | no | false |
| poetry-version | Version of poetry. Latest if not specified. | no | — |
Outputs
| name | description |
|---|---|
| output-table | pytest-cov markdown output table |
| cov-threshold-single-fail | boolean if any single file coverage less than cov-threshold-single |
| cov-threshold-total-fail | boolean if total coverage less than cov-threshold-total |