diff --git a/Makefile b/Makefile index 0b15e88..3659a68 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,12 @@ lint: test: pipenv run pytest tests/* --cov +build: + python3 -m build + +publish: + python3 -m twine upload dist/* + run: pipenv run python run.py diff --git a/codecov/main.py b/codecov/main.py index 135b552..e2f1a87 100644 --- a/codecov/main.py +++ b/codecov/main.py @@ -102,6 +102,7 @@ def process_pr( # pylint: disable=too-many-locals marker=marker, subproject_id=config.SUBPROJECT_ID, complete_project_report=config.COMPLETE_PROJECT_REPORT, + coverage_report_url=config.COVERAGE_REPORT_URL, ) except template.MissingMarker: log.error( diff --git a/codecov/settings.py b/codecov/settings.py index f7aef38..98ac80d 100644 --- a/codecov/settings.py +++ b/codecov/settings.py @@ -54,6 +54,7 @@ class Config: ANNOTATION_TYPE: str = 'warning' MAX_FILES_IN_COMMENT: int = 25 COMPLETE_PROJECT_REPORT: bool = False + COVERAGE_REPORT_URL: str | None = None # Only for debugging, not exposed in the action DEBUG: bool = False diff --git a/codecov/template.py b/codecov/template.py index fc27071..8948303 100644 --- a/codecov/template.py +++ b/codecov/template.py @@ -110,6 +110,7 @@ def get_comment_markdown( # pylint: disable=too-many-arguments,too-many-locals marker: str, subproject_id: str | None = None, complete_project_report: bool = False, + coverage_report_url: str | None = None, ): loader = CommentLoader(base_template=base_template) env = SandboxedEnvironment(loader=loader) @@ -155,6 +156,7 @@ def get_comment_markdown( # pylint: disable=too-many-arguments,too-many-locals subproject_id=subproject_id, marker=marker, complete_project_report=complete_project_report, + coverage_report_url=coverage_report_url, ) except jinja2.exceptions.TemplateError as exc: raise TemplateError from exc diff --git a/codecov/template_files/comment.md.j2 b/codecov/template_files/comment.md.j2 index e66ff38..3fc2c23 100644 --- a/codecov/template_files/comment.md.j2 +++ b/codecov/template_files/comment.md.j2 @@ -332,4 +332,9 @@ This report was generated by . +{%- endif -%} +{%- endblock full_coverage_report %} {{ marker -}}