Skip to content

Commit 2d28c9c

Browse files
authored
ci: fix coverage reporting with parallel runs (#60)
1 parent 475ec6d commit 2d28c9c

File tree

4 files changed

+18
-25
lines changed

4 files changed

+18
-25
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ jobs:
5252
shell: bash
5353
- run: tox -f py$(echo ${{ matrix.python-version }} | tr -d .)
5454
shell: bash
55+
- run: |
56+
uv run coverage combine
57+
uv run coverage xml
58+
shell: bash
5559
- uses: codecov/codecov-action@v5
5660
with:
5761
token: ${{ secrets.CODECOV_TOKEN }}

pyproject.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ dev = [
4343
"psycopg2>=2.9.10,<2.10;python_version<'3.11'",
4444
"psycopg2>=2.9;python_version>='3.11'",
4545
"pytest>=8,<9",
46-
"pytest-cov>=6,<7",
4746
"pytest-django>=4.5,<5",
47+
"coverage",
4848
]
4949

5050
[tool.ruff]
@@ -93,15 +93,22 @@ lint.isort.known-first-party = [ "django_migrate_sql", "tests" ]
9393
addopts = """\
9494
-v
9595
-Wdefault
96-
--cov=django_migrate_sql
97-
--cov-report=term
98-
--cov-report=xml
9996
--ds=tests.settings
10097
"""
10198
pythonpath = [ "src" ]
10299

103100
[tool.coverage.run]
104101
branch = true
102+
parallel = true
103+
source = [
104+
"django_migrate_sql",
105+
]
106+
107+
[tool.coverage.paths]
108+
source = [
109+
"src",
110+
".tox/**/site-packages",
111+
]
105112

106113
[tool.coverage.report]
107114
exclude_lines = [

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ deps =
2121
django42: Django>=4.2,<5.0
2222
commands =
2323
python \
24+
-m coverage run \
2425
-m pytest {posargs:tests}

uv.lock

Lines changed: 2 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)