Skip to content

Commit a6238d7

Browse files
committed
refactor: Language agnostic coverage action
1 parent 9487b3a commit a6238d7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.github/workflows/test-python.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
strategy:
2626
matrix:
2727
include:
28-
# Test latest python on Windows and macOS
2928
- { os: 'windows-latest', python-version: '3.13' }
3029
- { os: 'macos-latest', python-version: '3.13' }
3130
os: ['ubuntu-latest']
@@ -46,8 +45,11 @@ jobs:
4645
- name: Linting and testing
4746
run: uv run tox -e="lint,${{ matrix.python-version }}"
4847

49-
- name: Gather codecov report
50-
run: uvx codecov
48+
- name: Upload test results to Codecov
49+
uses: codecov/test-results-action@v1
50+
with:
51+
files: coverage.xml
52+
token: ${{ secrets.CODECOV_TOKEN }}
5153

5254
- name: Build package
5355
run: uv build

python/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pip-log.txt
2828

2929
# Unit test / coverage reports
3030
.coverage
31+
coverage.xml
3132
.tox
3233
nosetests.xml
3334

python/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ deps = ["pre-commit-uv>=4.1.1"]
8989
description = "Run linting and formatting checks (and auto-fixes)"
9090

9191
[tool.tox.env_run_base]
92-
commands = [["coverage", "run", "--append", "-m", "pytest", "-vvl"]]
92+
commands = [
93+
["coverage", "run", "--append", "-m", "pytest", "-vvl"],
94+
["coverage", "xml"]
95+
]
9396
dependency_groups = [
9497
"dev"
9598
]

0 commit comments

Comments
 (0)