fix coverage

This commit is contained in:
Ivan Schaller 2023-12-22 14:13:49 +01:00
parent 7ce4e0b8d7
commit 43ba14f6f0

View file

@ -13,6 +13,11 @@ on:
type: string type: string
description: "tests directory" description: "tests directory"
default: "tests" default: "tests"
use-hatch:
required: false
type: bool
description: "use hatch for coverage report"
default: false
secrets: secrets:
sonar-host: sonar-host:
@ -31,15 +36,24 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: get coverage (hatch)
if: ${{ inputs.run-coverage == true && inputs.use-hatch == true }}
run: hatch run default:cov
- name: install requirements - name: install requirements
if: ${{ inputs.run-coverage == true }} if: ${{ inputs.run-coverage == true && inputs.use-hatch == false }}
run: pip install -U pytest coverage run: pip install -U pytest coverage
- name: install package
if: ${{ inputs.run-coverage == true && inputs.use-hatch == false }}
run: pip install -U .
- name: get coverage - name: get coverage
if: ${{ inputs.run-coverage == true }} if: ${{ inputs.run-coverage == true && inputs.use-hatch == false }}
run: | run: |
coverage erase coverage erase
coverage run -m pytest --exitfirst --verbose ${{ inputs.tests-dir }} coverage run -m pytest --exitfirst --verbose ${{ inputs.tests-dir }}
coverage combine
coverage report coverage report
coverage xml coverage xml