Skip to content

Commit fd10740

Browse files
Implement testing workflow changes (#524)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 05bd13c commit fd10740

File tree

3 files changed

+410
-351
lines changed

3 files changed

+410
-351
lines changed

.github/workflows/check-build-deploy.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ jobs:
133133
pytest:
134134
needs: [uv-check]
135135
runs-on: ubuntu-latest
136+
permissions:
137+
id-token: write
136138
env:
137139
UV_NO_SYNC: true
138140
UV_FROZEN: true
@@ -165,7 +167,19 @@ jobs:
165167
key: pytest|${{steps.store-hashed-python-version.outputs.hashed_python_version}}
166168

167169
- name: Run pytest
168-
run: uv run -- pytest # TODO: Add GitHub workflows output format
170+
run: uv run pytest --cov --cov-branch --cov-report=xml --junitxml=junit.xml
171+
172+
- name: Upload test results to Codecov
173+
if: ${{ !cancelled() }}
174+
uses: codecov/test-results-action@v1
175+
with:
176+
use_oidc: true
177+
178+
- name: Upload coverage report to Codecov
179+
uses: codecov/codecov-action@v5
180+
if: ${{ !cancelled() }}
181+
with:
182+
use_oidc: true
169183

170184
ruff-lint:
171185
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ main = [
2121
"validators>=0.34",
2222
]
2323
pre-commit = ["pre-commit>=4.0"]
24-
test = ["pytest>=8.3"]
24+
test = ["pytest-cov>=6.1", "pytest>=8.3"]
2525
type-check = ["django-stubs[compatible-mypy]>=5.1", "mypy>=1.13", "types-beautifulsoup4>=4.12"]
2626

2727
[project] # TODO: Remove [project] table once https://github.com/astral-sh/uv/issues/8582 is completed
@@ -207,6 +207,12 @@ parametrize-values-type = "tuple"
207207
keep-runtime-typing = true
208208

209209

210+
[tool.coverage.report]
211+
exclude_also = ["if TYPE_CHECKING:"]
212+
skip_covered = true
213+
sort = "cover"
214+
215+
210216
[tool.pymarkdown]
211217
extensions.front-matter.enabled = true
212218
mode.strict-config = true

0 commit comments

Comments
 (0)