@@ -12,58 +12,83 @@ jobs:
12
12
lint :
13
13
runs-on : ubuntu-latest
14
14
15
+ env :
16
+ UV_CACHE_DIR : /tmp/.uv-cache
17
+
15
18
steps :
16
19
- 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.18/install.sh | sh
23
+
19
24
- name : Set up Python
20
25
uses : actions/setup-python@v5
21
26
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 }}
24
37
25
38
- 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
30
40
31
41
- name : Run mypy
32
- run : poetry run mypy .
42
+ run : uv run mypy .
33
43
if : always()
34
44
45
+ - name : Minimize uv cache
46
+ run : uv cache prune --ci
47
+
35
48
test :
36
49
runs-on : ubuntu-latest
37
50
strategy :
38
51
matrix :
39
52
python-version : ["3.10", "3.11", "3.12", "3.13-dev"]
40
53
fail-fast : false
41
54
55
+ env :
56
+ UV_CACHE_DIR : /tmp/.uv-cache
57
+
42
58
steps :
43
59
- 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.18/install.sh | sh
46
63
47
64
- name : Set up (release) Python ${{ matrix.python-version }}
48
65
uses : actions/setup-python@v5
49
66
if : " !endsWith(matrix.python-version, '-dev')"
50
67
with :
51
68
python-version : ${{ matrix.python-version }}
52
- cache : ' poetry'
53
69
54
70
- name : Set up (deadsnakes) Python ${{ matrix.python-version }}
55
71
uses : deadsnakes/action@v3.1.0
56
72
if : endsWith(matrix.python-version, '-dev')
57
73
with :
58
74
python-version : ${{ matrix.python-version }}
59
75
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
+
60
85
- name : Install dependencies
61
86
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
64
89
65
90
- name : Run tests w/tox
66
- run : tox
91
+ run : uv run tox
67
92
68
93
- name : Cache coverage for ${{ matrix.python-version }}
69
94
uses : actions/upload-artifact@v4
@@ -73,16 +98,20 @@ jobs:
73
98
if-no-files-found : error
74
99
include-hidden-files : true
75
100
101
+ - name : Minimize uv cache
102
+ run : uv cache prune --ci
103
+
76
104
combine-cov :
77
105
runs-on : ubuntu-latest
78
106
needs : test
79
107
80
108
steps :
81
109
- uses : actions/checkout@v4
110
+
82
111
- name : Set up Python
83
112
uses : actions/setup-python@v5
84
113
with :
85
- python-version : ' 3.x '
114
+ python-version-file : " pyproject.toml "
86
115
87
116
- name : Pull coverage workflow artifacts
88
117
uses : actions/download-artifact@v4
@@ -91,17 +120,17 @@ jobs:
91
120
92
121
- name : Install cov & combine
93
122
run : |
94
- pip install coverage
123
+ python -m pip install coverage
95
124
coverage combine ./cov_cache/**/.coverage
96
125
97
126
- name : Report coverage
98
127
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
103
128
coverage html
104
129
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
+
105
134
- name : Publish cov HTML
106
135
uses : actions/upload-artifact@v4
107
136
with :
0 commit comments