fix coverage
This commit is contained in:
parent
7ce4e0b8d7
commit
43ba14f6f0
1 changed files with 16 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Reference in a new issue