Repository navigation
53 lines (46 loc) · 1.52 KB
/
Copy pathpytest.yml
File metadata and controls
53 lines (46 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
name: pytest
on:
workflow_dispatch:
pull_request:
paths:
- "src/**"
- "tests/**"
- "pyproject.toml"
- "uv.lock"
- "Dockerfile"
- ".github/**"
- "entrypoint.sh"
permissions:
contents: write
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: true
version: 0.13.4
- name: Install dependencies
run: uv sync --locked
- name: Run tests (with coverage)
run: |
uv run pytest \
--junitxml=pytest.xml \
--cov-report=term-missing:skip-covered \
--cov=. \
| tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@c772f8e59c8562befa8eabbbf7cfabd2e4d69f00 # main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml