66 - main
77 pull_request :
88
9- jobs :
10- lint-test :
11- runs-on : ubuntu-latest
9+ permissions :
10+ contents : read
1211
12+ jobs :
13+ lint :
14+ runs-on : ubuntu-slim
1315 steps :
1416 - name : Checkout repository
1517 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+ with :
19+ persist-credentials : false
20+
21+ - name : Install uv
22+ uses : astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
23+ with :
24+ enable-cache : true
25+ resolution-strategy : " lowest"
1626
1727 - name : Setup Python
1828 uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1929 with :
20- python-version : 3.12
21- allow-prereleases : true
22- cache : pip
23- cache-dependency-path : uv.lock
24-
25- - name : Set up uv
26- run : curl -LsSf https://astral.sh/uv/install.sh | sh
30+ python-version-file : " pyproject.toml"
2731
2832 - name : Sync dependencies
2933 run : uv sync --group dev --group tests
3034
31- - name : Run pre-commit
32- run : uv run pre-commit run --all-files
35+ - name : Run prek
36+ run : uv run prek run --all-files
3337
3438 - name : Check formatting
3539 run : uv run ruff format --check .
@@ -38,21 +42,81 @@ jobs:
3842 run : uv run ruff check --output-format=github .
3943
4044 - name : Run mypy
41- run : uv run mypy --strict src/
45+ run : uv run mypy --strict src/ tests/
4246
43- - name : Run tests
44- run : uv run python -m coverage run -m pytest -v
47+ - name : Run ty
48+ run : uv run ty check .
4549
46- - name : Upload coverage reports to Codecov
47- uses : codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
48- env :
49- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
50+ test :
51+ runs-on : ubuntu-slim
52+ steps :
53+ - name : Checkout repository
54+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55+ with :
56+ persist-credentials : false
5057
51- docs :
52- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
58+ - name : Install uv
59+ uses : astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
60+ with :
61+ enable-cache : true
62+ resolution-strategy : " lowest"
63+
64+ - name : Setup Python
65+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
66+ with :
67+ python-version : 3.14
68+
69+ - name : Sync dependencies
70+ run : uv sync --group dev --group tests
71+
72+ - name : Run tests with coverage
73+ run : uv run python -m coverage run -m pytest -v --junitxml=junit.xml
74+
75+ - name : Create coverage report
76+ run : uv run coverage xml -o coverage.xml
77+
78+ - name : Upload coverage reports
79+ if : ${{ !cancelled() }}
80+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
81+ with :
82+ name : coverage-reports
83+ path : |
84+ coverage.xml
85+ junit.xml
86+ if-no-files-found : error
87+
88+ codecov :
89+ runs-on : ubuntu-slim
90+ needs : [test]
91+ if : ${{ always() }}
5392 permissions :
5493 contents : read
55- pages : write
5694 id-token : write
95+ steps :
96+ - name : Checkout repository
97+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
98+ with :
99+ persist-credentials : false
100+
101+ - name : Download coverage reports
102+ if : ${{ !cancelled() }}
103+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
104+ with :
105+ name : coverage-reports
106+ path : coverage
107+
108+ - name : Upload coverage to Codecov
109+ if : ${{ !cancelled() }}
110+ uses : codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
111+ with :
112+ report_type : coverage
113+ use_oidc : true
114+ files : coverage/coverage.xml
57115
58- uses : darbiadev/.github/.github/workflows/github-pages-python-sphinx.yaml@440166417b42442c6114aaa895094f0db7de9b78 # v15.2.0
116+ - name : Upload test results to Codecov
117+ if : ${{ !cancelled() }}
118+ uses : codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
119+ with :
120+ report_type : test_results
121+ use_oidc : true
122+ files : coverage/junit.xml
0 commit comments