Fix the coverage badge on GitLab by producing an XML report

This commit is contained in:
Raoul Snyman 2023-12-07 10:47:53 -07:00
parent fb4409792d
commit 5a8b57923f
2 changed files with 13 additions and 2 deletions

1
.gitignore vendored
View File

@ -33,6 +33,7 @@ __pycache__
build
cover
coverage
coverage.xml
dist
env
htmlcov

View File

@ -24,11 +24,16 @@ test-debian:
image: $IMAGE_BASE/debian
script:
- sh scripts/generate_resources.sh
- xvfb-run -s '-screen 0 1024x768x24' pytest-3 --color=no --disable-warnings --cov openlp --cov-report term
- xvfb-run -s '-screen 0 1024x768x24' pytest-3 --color=no --disable-warnings --cov openlp --cov-report term --cov-report xml:coverage.xml
- mv .coverage linux.coverage
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- linux.coverage
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
test-ubuntu:
stage: test
@ -102,11 +107,16 @@ pages:
- python3-coverage combine linux.coverage macos.coverage
- python3-coverage html
- mv htmlcov public
- python3-coverage report
- python3-coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- public
expire_in: 30 days
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
dependencies:
- test-debian
- test-macos-intel