Skip to content

Commit

Permalink
Fix broken upload to Codecov
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pgiraud committed Nov 19, 2024
1 parent 08e8d9e commit 2db8fb0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.egg-info/
*.pyc
.coverage
coverage.xml
.eggs
.mypy_cache/
.pybuild
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2db8fb0

Please sign in to comment.