1212 - main
1313 - " maintenance/**"
1414
15- env :
16- CACHE_VERSION : 5
17- KEY_PREFIX : venv
18-
19- permissions :
20- contents : read
15+ # permissions:
16+ # contents: read # Incompatible with astral-sh/setup-uv cache
2117
2218concurrency :
2319 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
3026 strategy :
3127 fail-fast : false
3228 matrix :
33- os : [ubuntu-latest]
29+ os : [ubuntu-latest, windows-latest ]
3430 python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
3531 include :
3632 - os : macos-latest
@@ -42,56 +38,32 @@ jobs:
4238 - os : ubuntu-latest
4339 python-version : " pypy-3.11"
4440 runs-on : ${{ matrix.os }}
45- outputs :
46- python-key : ${{ steps.generate-python-key.outputs.key }}
4741 steps :
4842 - name : Check out code from GitHub
494350- - 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
5346 with :
47+ enable-cache : true
5448 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
78- - name : Run pytest
79- run : |
80- . venv/bin/activate
81- pip list | grep 'astroid\|pylint'
82- python -m pytest --durations=10 --benchmark-disable --cov --cov-report= tests/
83- - 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
88- - name : Upload coverage artifact
89- if : runner.os == 'Linux'
90- 91- with :
92- name : coverage-${{ matrix.python-version }}
93- include-hidden-files : true
94- path : .coverage
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'
55+ # - name: Run pytest
56+ # run: |
57+ # python -m pytest --durations=10 --benchmark-disable --cov --cov-report= tests/
58+ # - name: Run functional tests with minimal messages config
59+ # run: python -m pytest -vv --minimal-messages-config tests/test_functional.py
60+ # - name: Upload coverage artifact
61+ # if: runner.os == 'Linux'
62+ 63+ # with:
64+ # name: coverage-${{ matrix.python-version }}
65+ # include-hidden-files: true
66+ # path: .coverage
9567
9668 coverage :
9769 name : process / coverage
@@ -101,26 +73,14 @@ jobs:
10173 steps :
10274 - name : Check out code from GitHub
10375104- - name : Set up Python 3.13
105- id : python
76+ - name : Set up Python 3.x
1067710778 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"
11980 - name : Download all coverage artifacts
1208112182 - name : Combine coverage results
12283 run : |
123- . venv/bin/activate
12484 coverage combine coverage*/.coverage
12585 coverage xml
12686 - uses : codecov/codecov-action@v5
@@ -147,18 +107,8 @@ jobs:
147107 with :
148108 python-version : ${{ matrix.python-version }}
149109 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 }}
159110 - name : Run pytest
160111 run : |
161- . venv/bin/activate
162112 pip install pygal
163113 pip install .
164114 pip list | grep 'astroid\|pylint'
@@ -179,52 +129,3 @@ jobs:
179129 steps.artifact-name-suffix.outputs.datetime }}
180130 include-hidden-files : true
181131 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