31
31
uses : actions/setup-python@v5
32
32
with :
33
33
python-version : ${{ env.DEFAULT_PYTHON }}
34
+ - name : Fetch HA pyproject
35
+ id : core-version
36
+ run : wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
34
37
- name : Compute cache key
35
38
id : set-key
36
39
run : echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
@@ -41,20 +44,13 @@ jobs:
41
44
needs : cache
42
45
name : Prepare
43
46
steps :
44
- - name : Check out committed code
45
- uses : actions/checkout@v4
46
- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
47
- id : python
48
- uses : actions/setup-python@v5
49
- with :
50
- python-version : ${{ env.DEFAULT_PYTHON }}
51
- - name : Create or reuse cache
47
+ - name : Prepare code checkout and python/pre-commit setup
52
48
id : cache-reuse
53
- uses : ./.github/ actions/restore-venv
49
+ uses : plugwise/gh- actions/prepare-python-and-code@v1
54
50
with :
55
51
cache-key : ${{ needs.cache.outputs.cache-key }}
56
- fail-on-miss : false # First time create cache (if not already exists)
57
- python-version : ${{ steps.python.outputs.python-version }}
52
+ fail-on-miss : false # First time create cache (if not already exists)
53
+ python-version : ${{ env.DEFAULT_PYTHON }}
58
54
venv-dir : ${{ env.VENV }}
59
55
precommit-home : ${{ env.PRE_COMMIT_HOME }}
60
56
@@ -69,17 +65,12 @@ jobs:
69
65
uses : actions/checkout@v4
70
66
with :
71
67
persist-credentials : false
72
- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
73
- id : python
74
- uses : actions/setup-python@v5
75
- with :
76
- python-version : ${{ env.DEFAULT_PYTHON }}
77
- - name : Create or reuse cache
68
+ - name : Restore cached environment
78
69
id : cache-reuse
79
- uses : ./.github/ actions/restore-venv
70
+ uses : plugwise/gh- actions/restore-venv@v1
80
71
with :
81
72
cache-key : ${{ needs.cache.outputs.cache-key }}
82
- python-version : ${{ steps.python.outputs.python-version }}
73
+ python-version : ${{ env.DEFAULT_PYTHON }}
83
74
venv-dir : ${{ env.VENV }}
84
75
precommit-home : ${{ env.PRE_COMMIT_HOME }}
85
76
- name : Ruff (with fix)
@@ -110,17 +101,12 @@ jobs:
110
101
steps :
111
102
- name : Check out committed code
112
103
uses : actions/checkout@v4
113
- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
114
- id : python
115
- uses : actions/setup-python@v5
116
- with :
117
- python-version : ${{ env.DEFAULT_PYTHON }}
118
- - name : Create or reuse cache
104
+ - name : Restore cached environment
119
105
id : cache-reuse
120
- uses : ./.github/ actions/restore-venv
106
+ uses : plugwise/gh- actions/restore-venv@v1
121
107
with :
122
108
cache-key : ${{ needs.cache.outputs.cache-key }}
123
- python-version : ${{ steps.python.outputs.python-version }}
109
+ python-version : ${{ env.DEFAULT_PYTHON }}
124
110
venv-dir : ${{ env.VENV }}
125
111
precommit-home : ${{ env.PRE_COMMIT_HOME }}
126
112
- name : Verify commit
@@ -150,18 +136,12 @@ jobs:
150
136
steps :
151
137
- name : Check out committed code
152
138
uses : actions/checkout@v4
153
- - name : Set up Python ${{ matrix.python-version }}
154
- id : python
155
- uses : actions/setup-python@v5
156
- with :
157
- python-version : ${{ matrix.python-version }}
158
- - name : Create or reuse cache
139
+ - name : Restore cached environment
159
140
id : cache-reuse
160
- uses : ./.github/ actions/restore-venv
141
+ uses : plugwise/gh- actions/restore-venv@v1
161
142
with :
162
- cache-key : ${{ needs.cache.outputs.cache-key }}-pytest-matrix-${{ matrix.python-version }}
163
- fail-on-miss : false # First time create cache (if not already exists)
164
- python-version : ${{ matrix.python-version }}
143
+ cache-key : ${{ needs.cache.outputs.cache-key }}
144
+ python-version : ${{ env.DEFAULT_PYTHON }}
165
145
venv-dir : ${{ env.VENV }}
166
146
precommit-home : ${{ env.PRE_COMMIT_HOME }}
167
147
- name : Run all tests
@@ -188,17 +168,12 @@ jobs:
188
168
uses : actions/checkout@v4
189
169
with :
190
170
persist-credentials : false
191
- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
192
- id : python
193
- uses : actions/setup-python@v5
194
- with :
195
- python-version : ${{ env.DEFAULT_PYTHON }}
196
- - name : Create or reuse cache
171
+ - name : Restore cached environment
197
172
id : cache-reuse
198
- uses : ./.github/ actions/restore-venv
173
+ uses : plugwise/gh- actions/restore-venv@v1
199
174
with :
200
175
cache-key : ${{ needs.cache.outputs.cache-key }}
201
- python-version : ${{ steps.python.outputs.python-version }}
176
+ python-version : ${{ env.DEFAULT_PYTHON }}
202
177
venv-dir : ${{ env.VENV }}
203
178
precommit-home : ${{ env.PRE_COMMIT_HOME }}
204
179
- name : Run mypy
@@ -238,17 +213,12 @@ jobs:
238
213
steps :
239
214
- name : Check out committed code
240
215
uses : actions/checkout@v4
241
- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
242
- id : python
243
- uses : actions/setup-python@v5
244
- with :
245
- python-version : ${{ env.DEFAULT_PYTHON }}
246
- - name : Create or reuse cache
216
+ - name : Restore cached environment
247
217
id : cache-reuse
248
- uses : ./.github/ actions/restore-venv
218
+ uses : plugwise/gh- actions/restore-venv@v1
249
219
with :
250
220
cache-key : ${{ needs.cache.outputs.cache-key }}
251
- python-version : ${{ steps.python.outputs.python-version }}
221
+ python-version : ${{ env.DEFAULT_PYTHON }}
252
222
venv-dir : ${{ env.VENV }}
253
223
precommit-home : ${{ env.PRE_COMMIT_HOME }}
254
224
- name : Download all coverage artifacts
@@ -275,17 +245,12 @@ jobs:
275
245
steps :
276
246
- name : Check out committed code
277
247
uses : actions/checkout@v4
278
- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
279
- id : python
280
- uses : actions/setup-python@v5
281
- with :
282
- python-version : ${{ env.DEFAULT_PYTHON }}
283
- - name : Create or reuse cache
248
+ - name : Restore cached environment
284
249
id : cache-reuse
285
- uses : ./.github/ actions/restore-venv
250
+ uses : plugwise/gh- actions/restore-venv@v1
286
251
with :
287
252
cache-key : ${{ needs.cache.outputs.cache-key }}
288
- python-version : ${{ steps.python.outputs.python-version }}
253
+ python-version : ${{ env.DEFAULT_PYTHON }}
289
254
venv-dir : ${{ env.VENV }}
290
255
precommit-home : ${{ env.PRE_COMMIT_HOME }}
291
256
- name : Install pypa/build
@@ -314,17 +279,12 @@ jobs:
314
279
steps :
315
280
- name : Check out committed code
316
281
uses : actions/checkout@v4
317
- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
318
- id : python
319
- uses : actions/setup-python@v5
320
- with :
321
- python-version : ${{ env.DEFAULT_PYTHON }}
322
- - name : Create or reuse cache
282
+ - name : Restore cached environment
323
283
id : cache-reuse
324
- uses : ./.github/ actions/restore-venv
284
+ uses : plugwise/gh- actions/restore-venv@v1
325
285
with :
326
286
cache-key : ${{ needs.cache.outputs.cache-key }}
327
- python-version : ${{ steps.python.outputs.python-version }}
287
+ python-version : ${{ env.DEFAULT_PYTHON }}
328
288
venv-dir : ${{ env.VENV }}
329
289
precommit-home : ${{ env.PRE_COMMIT_HOME }}
330
290
- name : Run complexity report (click to view details)
0 commit comments