From 3aba6a99c5678758b37805f6f2b8c5e326c7d9b0 Mon Sep 17 00:00:00 2001 From: Pierre GIRAUD Date: Tue, 19 Nov 2024 11:03:29 +0100 Subject: [PATCH] Fix broken upload to Codecov Codecov now requires a TOKEN to upload results. We update the version of the github action and use the token added in the project settings. We write the coverage report as XML in a file for codecov upload to be happy. With the default .coverage file, codecov reports a "no coverage file found" error. --- .github/workflows/tests.yml | 4 +++- .gitignore | 2 +- tox.ini | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 817498a..aedec37 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,4 +25,6 @@ jobs: tox -v -e tests-ci - name: Upload coverage to Codecov if: ${{ matrix.python-version == '3.12' }} - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 63c8315..ed40235 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ *.egg-info/ *.pyc -.coverage +coverage.xml .eggs .mypy_cache/ .pybuild diff --git a/tox.ini b/tox.ini index 8c69db2..82372a8 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ skip_install = true allowlist_externals = ./tests/datatests.sh commands = - pytest -ra --cov --cov-report=term-missing {posargs} + pytest -ra --cov --cov-report=term-missing --cov-report=xml {posargs} ci: ./tests/datatests.sh deps = ci: codecov