From 7c66f64049884dce09d3121d4ceb6e09d3e1210c Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 17 Oct 2022 21:54:53 -0400 Subject: [PATCH] ci: combine coverage from the run Signed-off-by: Henry Schreiner --- .github/workflows/test.yml | 9 +++++---- tox.ini | 10 ++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69b6b5652..1dec8867b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,6 +51,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Setup python for test ${{ matrix.py }} uses: actions/setup-python@v4 @@ -95,10 +97,9 @@ jobs: if: matrix.tox-target == 'tox' && matrix.py == '3.10' run: tox -e path - - name: Rename coverage report file - if: matrix.tox-target == 'tox' - run: mv ".tox/coverage.${BASE}.xml" .tox/coverage.xml - shell: bash + - name: Combine coverage files + if: always() + run: tox -e coverage - uses: codecov/codecov-action@v3 if: always() diff --git a/tox.ini b/tox.ini index 612806b61..be6b05234 100644 --- a/tox.ini +++ b/tox.ini @@ -47,6 +47,7 @@ commands = description = verify build can run from source (bootstrap) setenv = PYTHONPATH = {toxinidir}/src + COVERAGE_FILE = {toxworkdir}/.coverage.{envname} commands_pre = python -E -m pip uninstall -y build colorama @@ -59,9 +60,8 @@ commands = [testenv:{py311, py310, py39, py38, py37, py36, pypy37, pypy38, pypy39}-min] description = check minimum versions required of all dependencies skip_install = true -commands = +commands_pre = pip install .[test] -c tests/constraints.txt - pytest -ra {posargs:-n auto} [testenv:docs] description = build documentations @@ -88,15 +88,13 @@ commands = description = combine coverage from test environments passenv = DIFF_AGAINST -setenv = - COVERAGE_FILE = {toxworkdir}/.coverage skip_install = true deps = - coverage>=5.1 + coverage[toml]>=5.1 diff_cover>=3 parallel_show_output = true commands = - coverage combine + coverage combine {toxworkdir} coverage report --skip-covered --show-missing -i coverage xml -o {toxworkdir}/coverage.xml -i coverage html -d {toxworkdir}/htmlcov -i