@@ -12,58 +12,83 @@ jobs:
1212 lint :
1313 runs-on : ubuntu-latest
1414
15+ env :
16+ UV_CACHE_DIR : /tmp/.uv-cache
17+
1518 steps :
1619 - uses : actions/checkout@v4
17- - name : Install Poetry for caching
18- run : pipx install poetry
20+
21+ - name : Set up uv
22+ run : curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
23+
1924 - name : Set up Python
2025 uses : actions/setup-python@v5
2126 with :
22- python-version : ' 3.x'
23- cache : ' poetry'
27+ python-version-file : " pyproject.toml"
28+
29+ - name : Restore uv cache
30+ uses : actions/cache@v4
31+ with :
32+ path : /tmp/.uv-cache
33+ key : uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
34+ restore-keys : |
35+ uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
36+ uv-${{ runner.os }}
2437
2538 - name : Install dependencies
26- run : |
27- python -m pip install -U pip setuptools importlib-metadata
28- python -m pip install poetry
29- poetry install
39+ run : uv sync --all-extras --dev
3040
3141 - name : Run mypy
32- run : poetry run mypy .
42+ run : uv run mypy .
3343 if : always()
3444
45+ - name : Minimize uv cache
46+ run : uv cache prune --ci
47+
3548 test :
3649 runs-on : ubuntu-latest
3750 strategy :
3851 matrix :
39- python-version : ["3.11", "3.12", "3.13-dev "]
52+ python-version : ["3.11", "3.12", "3.13"]
4053 fail-fast : false
4154
55+ env :
56+ UV_CACHE_DIR : /tmp/.uv-cache
57+
4258 steps :
4359 - uses : actions/checkout@v4
44- - name : Install Poetry for caching
45- run : pipx install poetry
60+
61+ - name : Set up uv
62+ run : curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
4663
4764 - name : Set up (release) Python ${{ matrix.python-version }}
4865 uses : actions/setup-python@v5
4966 if : " !endsWith(matrix.python-version, '-dev')"
5067 with :
5168 python-version : ${{ matrix.python-version }}
52- cache : ' poetry'
5369
5470 - name : Set up (deadsnakes) Python ${{ matrix.python-version }}
5571 uses :
deadsnakes/[email protected] 5672 if : endsWith(matrix.python-version, '-dev')
5773 with :
5874 python-version : ${{ matrix.python-version }}
5975
76+ - name : Restore uv cache
77+ uses : actions/cache@v4
78+ with :
79+ path : /tmp/.uv-cache
80+ key : uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
81+ restore-keys : |
82+ uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
83+ uv-${{ runner.os }}
84+
6085 - name : Install dependencies
6186 run : |
62- python -m pip install -U pip setuptools importlib-metadata
63- pip install tox-gh-actions
87+ uv venv
88+ uv pip install tox-gh-actions tox-uv
6489
6590 - name : Run tests w/tox
66- run : tox
91+ run : uv run tox
6792
6893 - name : Cache coverage for ${{ matrix.python-version }}
6994 uses : actions/upload-artifact@v4
@@ -73,16 +98,20 @@ jobs:
7398 if-no-files-found : error
7499 include-hidden-files : true
75100
101+ - name : Minimize uv cache
102+ run : uv cache prune --ci
103+
76104 combine-cov :
77105 runs-on : ubuntu-latest
78106 needs : test
79107
80108 steps :
81109 - uses : actions/checkout@v4
110+
82111 - name : Set up Python
83112 uses : actions/setup-python@v5
84113 with :
85- python-version : ' 3.x '
114+ python-version-file : " pyproject.toml "
86115
87116 - name : Pull coverage workflow artifacts
88117 uses : actions/download-artifact@v4
@@ -91,17 +120,17 @@ jobs:
91120
92121 - name : Install cov & combine
93122 run : |
94- pip install coverage
123+ python -m pip install coverage
95124 coverage combine ./cov_cache/**/.coverage
96125
97126 - name : Report coverage
98127 run : |
99- echo '**Combined Coverage**' >> $GITHUB_STEP_SUMMARY
100- echo '```' >> $GITHUB_STEP_SUMMARY
101- coverage report -m --skip-covered >> $GITHUB_STEP_SUMMARY
102- echo '```' >> $GITHUB_STEP_SUMMARY
103128 coverage html
104129
130+ # Report a markdown version to the action summary
131+ echo '**Combined Coverage**' >> $GITHUB_STEP_SUMMARY
132+ coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
133+
105134 - name : Publish cov HTML
106135 uses : actions/upload-artifact@v4
107136 with :
0 commit comments