12
12
- main
13
13
- " maintenance/**"
14
14
15
- env :
16
- CACHE_VERSION : 5
17
- KEY_PREFIX : venv
18
-
19
15
permissions :
20
16
contents : read
21
17
30
26
strategy :
31
27
fail-fast : false
32
28
matrix :
33
- os : [ubuntu-latest]
29
+ os : [ubuntu-latest, windows-latest ]
34
30
python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
35
31
include :
36
32
- os : macos-latest
@@ -42,49 +38,25 @@ jobs:
42
38
- os : ubuntu-latest
43
39
python-version : " pypy-3.11"
44
40
runs-on : ${{ matrix.os }}
45
- outputs :
46
- python-key : ${{ steps.generate-python-key.outputs.key }}
47
41
steps :
48
42
- name : Check out code from GitHub
49
43
50
- - name : Set up Python ${{ matrix.python-version }}
51
- id : python
52
-
44
+ - name : Set up uv with Python ${{ matrix.python-version }} on ${{ matrix.os }}
45
+ uses : astral-sh/setup-uv@v5
53
46
with :
47
+ enable-cache : true
54
48
python-version : ${{ matrix.python-version }}
55
- check-latest : true
56
- - name : Generate partial Python venv restore key
57
- id : generate-python-key
58
- run : >-
59
- echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
60
- hashFiles('pyproject.toml', 'requirements_test.txt',
61
- 'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
62
- $GITHUB_OUTPUT
63
- - name : Restore Python virtual environment
64
- id : cache-venv
65
-
66
- with :
67
- path : venv
68
- key : >-
69
- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
70
- steps.generate-python-key.outputs.key }}
71
- - name : Create Python virtual environment
72
- if : steps.cache-venv.outputs.cache-hit != 'true'
73
- run : |
74
- python -m venv venv
75
- . venv/bin/activate
76
- python -m pip install --upgrade pip setuptools wheel
77
- pip install --upgrade --requirement requirements_test.txt
49
+ - run : |
50
+ uv pip install --python=${{ matrix.python-version }} pip
51
+ pip --version
52
+ uv pip --version
53
+ - run : uv pip install --editable ".[dev,testutils]"
54
+ - run : pip list | grep 'astroid\|pylint'
78
55
- name : Run pytest
79
- run : |
80
- . venv/bin/activate
81
- pip list | grep 'astroid\|pylint'
56
+ run :
82
57
python -m pytest --durations=10 --benchmark-disable --cov --cov-report= tests/
83
58
- name : Run functional tests with minimal messages config
84
- run : |
85
- . venv/bin/activate
86
- pip list | grep 'astroid\|pylint'
87
- python -m pytest -vv --minimal-messages-config tests/test_functional.py
59
+ run : python -m pytest -vv --minimal-messages-config tests/test_functional.py
88
60
- name : Upload coverage artifact
89
61
if : runner.os == 'Linux'
90
62
@@ -101,26 +73,14 @@ jobs:
101
73
steps :
102
74
- name : Check out code from GitHub
103
75
104
- - name : Set up Python 3.13
105
- id : python
76
+ - name : Set up Python 3.x
106
77
107
78
with :
108
- python-version : " 3.13"
109
- check-latest : true
110
- - name : Restore Python virtual environment
111
- id : cache-venv
112
-
113
- with :
114
- path : venv
115
- fail-on-cache-miss : true
116
- key :
117
- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
118
- needs.tests-linux.outputs.python-key }}
79
+ python-version : " 3.x"
119
80
- name : Download all coverage artifacts
120
81
121
82
- name : Combine coverage results
122
83
run : |
123
- . venv/bin/activate
124
84
coverage combine coverage*/.coverage
125
85
coverage xml
126
86
- uses : codecov/codecov-action@v5
@@ -147,18 +107,8 @@ jobs:
147
107
with :
148
108
python-version : ${{ matrix.python-version }}
149
109
check-latest : true
150
- - name : Restore Python virtual environment
151
- id : cache-venv
152
-
153
- with :
154
- path : venv
155
- fail-on-cache-miss : true
156
- key :
157
- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
158
- needs.tests-linux.outputs.python-key }}
159
110
- name : Run pytest
160
111
run : |
161
- . venv/bin/activate
162
112
pip install pygal
163
113
pip install .
164
114
pip list | grep 'astroid\|pylint'
@@ -179,52 +129,3 @@ jobs:
179
129
steps.artifact-name-suffix.outputs.datetime }}
180
130
include-hidden-files : true
181
131
path : .benchmarks/
182
-
183
- tests-windows :
184
- name : run / ${{ matrix.python-version }} / Windows
185
- runs-on : windows-latest
186
- timeout-minutes : 25
187
- needs : tests
188
- strategy :
189
- fail-fast : false
190
- matrix :
191
- python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
192
- steps :
193
- - name : Set temp directory
194
- run : echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
195
- # Workaround to set correct temp directory on Windows
196
- # https://github.com/actions/virtual-environments/issues/712
197
- - name : Check out code from GitHub
198
-
199
- - name : Set up Python ${{ matrix.python-version }}
200
- id : python
201
-
202
- with :
203
- python-version : ${{ matrix.python-version }}
204
- check-latest : true
205
- - name : Generate partial Python venv restore key
206
- id : generate-python-key
207
- run : >-
208
- echo "key=venv-${{ env.CACHE_VERSION }}-${{
209
- hashFiles('pyproject.toml', 'requirements_test_min.txt')
210
- }}" >> $env:GITHUB_OUTPUT
211
- - name : Restore Python virtual environment
212
- id : cache-venv
213
-
214
- with :
215
- path : venv
216
- key : >-
217
- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
218
- steps.generate-python-key.outputs.key }}
219
- - name : Create Python virtual environment
220
- if : steps.cache-venv.outputs.cache-hit != 'true'
221
- run : |
222
- python -m venv venv
223
- . venv\\Scripts\\activate
224
- python -m pip install --upgrade pip setuptools wheel
225
- pip install --upgrade --requirement requirements_test_min.txt
226
- - name : Run pytest
227
- run : |
228
- . venv\\Scripts\\activate
229
- pip list | grep 'astroid\|pylint'
230
- python -m pytest --durations=10 --benchmark-disable tests/
0 commit comments