Skip to content

Commit c49bb7e

Browse files
authored
🔧 Add coverage workflow (#125)
* Add coverage workflow
1 parent 82819bb commit c49bb7e

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

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