From 02bfa455604a9ddd891a7b52631e560d70438064 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 27 Jan 2022 18:14:06 +0200 Subject: [PATCH] CI: try to fix Codecov with multiple tox environments --- .github/workflows/test.yml | 6 +++++- Makefile | 6 +++--- tox.ini | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f054106b..e3e895952 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,4 +28,8 @@ jobs: python -m pip install tox tox-gh-actions==2.1.0 - name: Run test via Tox run: tox --skip-missing-interpreters - - uses: codecov/codecov-action@v1 + env: + COVERAGE_XML_PATH: ${{ runner.temp }} + - uses: codecov/codecov-action@v2 + with: + directory: ${{ runner.temp }} diff --git a/Makefile b/Makefile index 59c8555d9..d24a4fd70 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ test: import-cldr - @PYTHONWARNINGS=default python ${PYTHON_TEST_FLAGS} -m pytest + @PYTHONWARNINGS=default python ${PYTHON_TEST_FLAGS} -m pytest ${PYTEST_FLAGS} test-cov: import-cldr - @PYTHONWARNINGS=default python ${PYTHON_TEST_FLAGS} -m pytest --cov=babel + @PYTHONWARNINGS=default python ${PYTHON_TEST_FLAGS} -m pytest --cov=babel ${PYTEST_FLAGS} test-env: @virtualenv test-env @@ -13,7 +13,7 @@ clean-test-env: @rm -rf test-env standalone-test: import-cldr test-env - @test-env/bin/pytest tests + @test-env/bin/pytest tests ${PYTEST_FLAGS} clean: clean-cldr clean-pyc clean-test-env diff --git a/tox.ini b/tox.ini index 5cd0a6ebf..05e359a0c 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,8 @@ deps = tzdata;sys_platform == 'win32' whitelist_externals = make commands = make clean-cldr test-cov +env = + PYTEST_FLAGS=--cov-report=xml:{env:COVERAGE_XML_PATH:.coverage_cache}/coverage.{envname}.xml passenv = BABEL_* PYTHON_*