11---
22name : CI
33
4+ permissions : {}
5+
46on :
57 push :
68 branches : ["main"]
@@ -17,28 +19,24 @@ jobs:
1719 matrix :
1820 python-version : ["3.11", "3.12", "3.13", "3.14"]
1921 redis-version : [6]
22+ fail-fast : false
2023
2124 steps :
2225 - uses : " actions/checkout@v4"
23-
24- - uses : " pdm-project/setup-pdm@v4"
2526 with :
26- python-version : " ${{ matrix.python-version }} "
27- allow-python-prereleases : true
28- cache : true
29- version : " 2.25.9 "
27+ persist-credentials : false
28+
29+ - uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0
30+ - uses : hynek/setup-cached-uv@757bedc3f972eb7227a1aa657651f15a8527c817 # v2.3.0
3031
3132 - name : " Start Redis"
32- uses : " supercharge/redis-github-action@1.2.0 "
33+ uses : " supercharge/redis-github-action@ea9b21c6ecece47bd99595c532e481390ea0f044 " # 1.8.0
3334 with :
3435 redis-version : " ${{ matrix.redis-version }}"
3536
36- - uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0
37-
38- - name : " Run Tox"
37+ - name : " Run Tests"
3938 run : |
40- python -Im pip install --upgrade tox tox-gh-actions
41- python -Im tox
39+ just python=${{ matrix.python-version }} covcleanup="false" cov
4240
4341 - name : Upload coverage data
4442 uses : actions/upload-artifact@v4
@@ -55,34 +53,31 @@ jobs:
5553
5654 steps :
5755 - uses : " actions/checkout@v4"
58-
59- - uses : " actions/setup-python@v5"
6056 with :
61- cache : " pip"
62- python-version : " 3.12"
63-
64- - run : " python -Im pip install --upgrade coverage[toml]"
57+ persist-credentials : false
6558
6659 - name : Download coverage data
6760 uses : actions/download-artifact@v4
6861 with :
6962 pattern : coverage-data-*
7063 merge-multiple : true
64+
65+ - uses : hynek/setup-cached-uv@757bedc3f972eb7227a1aa657651f15a8527c817 # v2.3.0
7166
7267 - name : " Combine coverage"
7368 run : |
74- python -Im coverage combine
75- python -Im coverage html --skip-covered --skip-empty
76- python -Im coverage json
69+ uv run --group test coverage combine
70+ uv run --group test coverage html
71+ uv run --group test coverage json
7772
7873 # Report and write to summary.
79- python -Im coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
74+ uv run --group test coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
8075
81- export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
76+ export TOTAL=$(uv run python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
8277 echo "total=$TOTAL" >> $GITHUB_ENV
8378
8479 # Report again and fail if under the threshold.
85- python -Im coverage report --fail-under=97
80+ uv run --group test coverage report --fail-under=98
8681
8782 - name : " Upload HTML report."
8883 uses : " actions/upload-artifact@v4"
@@ -105,28 +100,40 @@ jobs:
105100 maxColorRange : 90
106101 valColorRange : ${{ env.total }}
107102
103+ lint :
104+ name : " Run linters"
105+ runs-on : " ubuntu-latest"
106+ steps :
107+ - uses : " actions/checkout@v4"
108+ with :
109+ persist-credentials : false
110+
111+ - uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0
112+ - uses : hynek/setup-cached-uv@757bedc3f972eb7227a1aa657651f15a8527c817 # v2.3.0
113+
114+ - name : " Run linters"
115+ run : |
116+ just lint
117+
108118 package :
109119 name : " Build & verify package"
110120 runs-on : " ubuntu-latest"
111121
112122 steps :
113- - uses : " actions/checkout@v3"
114-
115- - uses : " actions/setup-python@v4"
123+ - uses : " actions/checkout@v4"
116124 with :
117- python-version : " 3.11 "
125+ persist-credentials : false
118126
119- - name : " Install tools"
120- run : " python -m pip install twine check-wheel-contents build"
127+ - uses : hynek/setup-cached-uv@757bedc3f972eb7227a1aa657651f15a8527c817
121128
122129 - name : " Build package"
123- run : " python -m build"
130+ run : " uvx --from build pyproject- build"
124131
125132 - name : " List result"
126133 run : " ls -l dist"
127134
128135 - name : " Check wheel contents"
129- run : " check-wheel-contents dist/*.whl"
136+ run : " uvx check-wheel-contents dist/*.whl"
130137
131138 - name : " Check long_description"
132- run : " python -m twine check dist/*"
139+ run : " uvx twine check dist/*"
0 commit comments