Fixed path to coverage config file.

This commit is contained in:
Patrick Lehmann
2022-11-03 07:55:45 +01:00
parent 5f6d1b5254
commit 81c1f12836
4 changed files with 11 additions and 11 deletions

View File

@@ -35,13 +35,13 @@ on:
required: false
default: '-r tests/requirements.txt'
type: string
test_directory:
tests_directory:
description: 'Path to the directory containing tests (test working directory).'
required: false
default: 'tests'
type: string
unittest_directory:
description: 'Path to the directory containing unit tests (relative to test_directory).'
description: 'Path to the directory containing unit tests (relative to tests_directory).'
required: false
default: 'unit'
type: string
@@ -127,8 +127,8 @@ jobs:
- name: Collect coverage
continue-on-error: true
run: |
cd ${{ inputs.test_directory }}
[ 'x${{ inputs.coverage_config }}' != 'x' ] && PYCOV_ARGS='--cov-config=${{ inputs.coverage_config }}' || unset PYCOV_ARGS
cd ${{ inputs.tests_directory }}
[ 'x${{ inputs.coverage_config }}' != 'x' ] && PYCOV_ARGS='--cov-config=../${{ inputs.coverage_config }}' || unset PYCOV_ARGS
python -m pytest -rA --cov=. $PYCOV_ARGS ${{ inputs.unittest_directory }} --color=yes
- name: Convert to cobertura format

View File

@@ -97,13 +97,13 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: 🔧 Install wheel and pip dependencies
- name: 🔧 Install wheel and pip dependencies (native)
if: matrix.system != 'msys2'
run: |
python -m pip install --disable-pip-version-check -U wheel
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
- name: 🔧 Install pip dependencies
- name: 🔧 Install pip dependencies (MSYS2)
if: matrix.system == 'msys2'
run: |
if [ 'x${{ inputs.mingw_requirements }}' != 'x' ]; then
@@ -112,14 +112,14 @@ jobs:
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
fi
- name: ☑ Run unit tests
- name: ☑ Run unit tests (Windows)
if: matrix.system == 'windows'
run: |
cd ${{ inputs.tests_directory }}
$PYTEST_ARGS = if ("${{ inputs.artifact }}".length -gt 0) { "--junitxml=TestReportSummary.xml" } else { "" }
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes
- name: ☑ Run unit tests
- name: ☑ Run unit tests (Ubuntu/macOS)
if: matrix.system != 'windows'
run: |
cd ${{ inputs.tests_directory }}