Skip to content
Snippets Groups Projects
Commit 044146b4 authored by Klaas Kliffen's avatar Klaas Kliffen :satellite:
Browse files

Merge branch 'add_coverage_in_pipeline' into 'main'

CWG-57: Add coverage in pipeline and badges to readmes

See merge request python-package!16
parents edd53340 81d18e31
Branches
No related tags found
No related merge requests found
......@@ -8,6 +8,19 @@ trigger_prepare:
include: "{{cookiecutter.project_slug}}/.prepare.gitlab-ci.yml"
default:
# Bootstrap Cookiecutter template to test provided ci pipeline template
before_script:
- python --version # For debugging
- cookiecutter --no-input --overwrite-if-exists -output-dir .
- cookiecutter --no-input --overwrite-if-exists --output-dir . .
- cd my_awesome_app
- git init
# Override artifact directories
run_unit_tests_coverage:
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: my_awesome_app/coverage.xml
paths:
- my_awesome_app/htmlcov/*
# Example Python Package
![Build status](https://git.astron.nl/templates/python-package/badges/main/pipeline.svg)
![Test coverage](https://git.astron.nl/templates/python-package/badges/main/coverage.svg)
An example repository of an CI/CD pipeline for building, testing and publishing a python package.
If you find some missing functionality with regards to CI/CD, testing, linting or something else, feel free to make a merge request with the proposed changes.
......
......@@ -75,6 +75,7 @@ run_unit_tests_coverage:
stage: test
script:
- tox -e coverage
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
......
# {{cookiecutter.project_name}}
<!-- TODO: replace -->
![Build status](https://git.astron.nl/templates/python-package/badges/main/pipeline.svg)
![Test coverage](https://git.astron.nl/templates/python-package/badges/main/coverage.svg)
<!-- ![Latest release](https://git.astron.nl/templates/python-package/badges/main/release.svg) -->
An example repository of an CI/CD pipeline for building, testing and publishing a python package.
## Installation
......
......@@ -22,7 +22,7 @@ commands =
[testenv:coverage]
commands =
{envpython} --version
{envpython} -m pytest --cov-report xml --cov-report html --cov={{cookiecutter.project_slug}}
{envpython} -m pytest --cov-report term --cov-report xml --cov-report html --cov={{cookiecutter.project_slug}}
# Use generative name and command prefixes to reuse the same virtualenv
# for all linting jobs.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment