Skip to content

Commit 92da537

Browse files
committed
Add coverage workflow
1 parent 82819bb commit 92da537

4 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/coverage.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run tests and upload coverage
2+
3+
on:
4+
push
5+
6+
jobs:
7+
test:
8+
name: Run tests and collect coverage
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install uv
14+
uses: astral-sh/setup-uv@v5
15+
16+
- name: uv sync
17+
run: |
18+
uv sync --all-group --all-extras
19+
20+
- name: Run tests
21+
run: uv run make coverage
22+
23+
- name: Upload results to Codecov
24+
uses: codecov/codecov-action@v5
25+
with:
26+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ _build
2121
.VSCodeCounter
2222

2323
uv.lock
24+
25+
.coverage
26+
coverage.xml

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ test:
1414
test-matrix:
1515
nox
1616

17+
.PHONY: coverage
18+
coverage:
19+
pytest --cov --cov-branch --cov-report=xml
20+
1721
.PHONY: docs-html
1822
docs-html:
1923
make --directory docs/ clean && make --directory docs/ html

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ test = [
3232
"nox>=2025.2.9",
3333
"pytest-xdist",
3434
"pytest>=7.0",
35+
"pytest-cov",
3536
"sphinx_design",
3637
"sphinxcontrib-plantuml",
3738
]

0 commit comments

Comments
 (0)