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