Skip to content

Commit 4a9fe80

Browse files
committed
add pytest workflow
1 parent 7da0089 commit 4a9fe80

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/pytest.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: pytest
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v6
18+
with:
19+
python-version-file: "pyproject.toml"
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
23+
with:
24+
enable-cache: true
25+
version: 0.*.*
26+
27+
- name: Install dependencies
28+
run: uv sync --locked
29+
30+
- name: Run tests (with coverage)
31+
run: |
32+
uv run pytest \
33+
--junitxml=pytest.xml \
34+
--cov-report=term-missing:skip-covered \
35+
--cov=. \
36+
| tee pytest-coverage.txt
37+
38+
- name: Pytest coverage comment
39+
uses: MishaKav/pytest-coverage-comment@main
40+
with:
41+
pytest-coverage-path: ./pytest-coverage.txt
42+
junitxml-path: ./pytest.xml

0 commit comments

Comments
 (0)