Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ lint:
test:
pipenv run pytest tests/* --cov

report:
pipenv run pytest tests --cov-branch --cov=codecov --cov-report=json:/tmp/report.json

build:
python3 -m build

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Create a Coverage report comment on Github PR

run:

To generate the pytest coverage report

```bash
pipenv run pytest tests --cov-branch --cov=codecov --cov-report=json:/tmp/report.json
```

```bash
GITHUB_REPOSITORY=<repository_name> \
COVERAGE_PATH=<path_to_coverage_report> \
Expand Down Expand Up @@ -62,13 +68,14 @@ Note: Either `GITHUB_PR_NUMBER` or `GITHUB_REF` is required.
## Optional Environment Variables

- `GITHUB_BASE_REF`: The base branch for the pull request. Default is `main`.
- `SUBPROJECT_ID`: The ID or URL of the subproject or report. (Optional)
- `SUBPROJECT_ID`: The ID or URL of the subproject or report.
- `MINIMUM_GREEN`: The minimum coverage percentage for green status. Default is 100.
- `MINIMUM_ORANGE`: The minimum coverage percentage for orange status. Default is 70.
- `ANNOTATE_MISSING_LINES`: Whether to annotate missing lines in the coverage report. Default is False.
- `ANNOTATION_TYPE`: The type of annotation to use for missing lines. Default is 'warning'.
- `MAX_FILES_IN_COMMENT`: The maximum number of files to include in the coverage report comment. Default is 25.
- `COMPLETE_PROJECT_REPORT`: Whether to include the complete project coverage report in the comment. Default is False.
- `COVERAGE_REPORT_URL`: URL of the full coverage report to mention in the comment.
- `DEBUG`: Whether to enable debug mode. Default is False.

That's it! You have successfully cloned the repository and built the project.
Expand Down
2 changes: 1 addition & 1 deletion codecov/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Config:
GITHUB_TOKEN: str = dataclasses.field(repr=False)
GITHUB_PR_NUMBER: int | None = None
# Branch to run the action on (alternate to get PR number if not provided)
# Example Organisation:branch-name (Company:sample-branch)
# Example Organisation:branch-name (Company:sample-branch) or User:branch-name (user:sample-branch)
GITHUB_REF: str | None = None
GITHUB_BASE_REF: str = 'main'
SUBPROJECT_ID: str | None = None
Expand Down