3030 strategy :
3131 fail-fast : false
3232 matrix :
33- os : [ubuntu-latest]
33+ os : [ubuntu-latest, windows-latest ]
3434 python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
3535 include :
3636 - os : macos-latest
@@ -47,44 +47,22 @@ jobs:
4747 steps :
4848 - name : Check out code from GitHub
4949 uses : actions/checkout@v4.2.2
50- - name : Set up Python ${{ matrix.python-version }}
51- id : python
52- uses : actions/setup-python@v5.4.0
50+ - name : Set up uv with Python ${{ matrix.python-version }} on ${{ matrix.os }}
51+ uses : astral-sh/setup-uv@v5
5352 with :
53+ enable-cache : true
5454 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- uses : actions/cache@v4.2.3
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
55+ - run : |
56+ uv pip install --python=${{ matrix.python-version }} pip
57+ pip --version
58+ uv pip --version
59+ - run : uv pip install --editable ".[dev,testutils]"
60+ - run : pip list | grep 'astroid\|pylint'
7861 - name : Run pytest
79- run : |
80- . venv/bin/activate
81- pip list | grep 'astroid\|pylint'
62+ run :
8263 python -m pytest --durations=10 --benchmark-disable --cov --cov-report= tests/
8364 - 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
65+ run : python -m pytest -vv --minimal-messages-config tests/test_functional.py
8866 - name : Upload coverage artifact
8967 if : runner.os == 'Linux'
9068 uses : actions/upload-artifact@v4.6.2
@@ -101,26 +79,14 @@ jobs:
10179 steps :
10280 - name : Check out code from GitHub
10381 uses : actions/checkout@v4.2.2
104- - name : Set up Python 3.13
105- id : python
82+ - name : Set up Python 3.x
10683 uses : actions/setup-python@v5.4.0
10784 with :
108- python-version : " 3.13"
109- check-latest : true
110- - name : Restore Python virtual environment
111- id : cache-venv
112- uses : actions/cache@v4.2.3
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 }}
85+ python-version : " 3.x"
11986 - name : Download all coverage artifacts
12087 uses : actions/download-artifact@v4.2.1
12188 - name : Combine coverage results
12289 run : |
123- . venv/bin/activate
12490 coverage combine coverage*/.coverage
12591 coverage xml
12692 - uses : codecov/codecov-action@v5
@@ -147,18 +113,8 @@ jobs:
147113 with :
148114 python-version : ${{ matrix.python-version }}
149115 check-latest : true
150- - name : Restore Python virtual environment
151- id : cache-venv
152- uses : actions/cache@v4.2.3
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 }}
159116 - name : Run pytest
160117 run : |
161- . venv/bin/activate
162118 pip install pygal
163119 pip install .
164120 pip list | grep 'astroid\|pylint'
@@ -179,52 +135,3 @@ jobs:
179135 steps.artifact-name-suffix.outputs.datetime }}
180136 include-hidden-files : true
181137 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- uses : actions/checkout@v4.2.2
199- - name : Set up Python ${{ matrix.python-version }}
200- id : python
201- uses : actions/setup-python@v5.4.0
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- uses : actions/cache@v4.2.3
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