@@ -72,16 +72,11 @@ jobs:
72
72
persist-credentials : false
73
73
- name : " Cleanup docker"
74
74
run : ./scripts/ci/cleanup_docker.sh
75
- - uses : actions/setup-python@v5
76
- with :
77
- python-version : " ${{ inputs.default-python-version }}"
78
- cache : ' pip'
79
- cache-dependency-path : ./dev/breeze/pyproject.toml
80
- - run : pip install --editable ./dev/breeze/
81
- - run : python -m pytest -n auto --color=yes
75
+ - name : " Install Breeze"
76
+ uses : ./.github/actions/breeze
77
+ - run : uv tool run --from apache-airflow-breeze pytest -n auto --color=ye
82
78
working-directory : ./dev/breeze/
83
79
84
-
85
80
tests-ui :
86
81
timeout-minutes : 10
87
82
name : React UI tests
@@ -108,15 +103,24 @@ jobs:
108
103
node-version : 21
109
104
cache : ' pnpm'
110
105
cache-dependency-path : ' airflow/ui/pnpm-lock.yaml'
111
- - name : " Cache eslint"
112
- uses : actions/cache@v4
106
+ - name : " Restore eslint cache (ui) "
107
+ uses : apache/infrastructure- actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
113
108
with :
114
- path : ' airflow/ui/node_modules'
109
+ path : ' airflow/ui/node_modules/ '
115
110
key : ${{ runner.os }}-ui-node-modules-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
111
+ id : restore-eslint-cache
116
112
- run : cd airflow/ui && pnpm install --frozen-lockfile
117
113
- run : cd airflow/ui && pnpm test
118
114
env :
119
115
FORCE_COLOR : 2
116
+ - name : " Save eslint cache (ui)"
117
+ uses : apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
118
+ with :
119
+ path : ' airflow/ui/node_modules/'
120
+ key : ${{ runner.os }}-ui-node-modules-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
121
+ if-no-files-found : ' error'
122
+ retention-days : ' 2'
123
+ if : steps.restore-eslint-cache.outputs.cache-hit != 'true'
120
124
121
125
tests-www :
122
126
timeout-minutes : 10
@@ -137,15 +141,60 @@ jobs:
137
141
uses : actions/setup-node@v4
138
142
with :
139
143
node-version : 21
140
- - name : " Cache eslint"
141
- uses : actions/cache@v4
144
+ - name : " Restore eslint cache (www) "
145
+ uses : apache/infrastructure- actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
142
146
with :
143
- path : ' airflow/www/node_modules'
147
+ path : ' airflow/www/node_modules/ '
144
148
key : ${{ runner.os }}-www-node-modules-${{ hashFiles('airflow/www/**/yarn.lock') }}
149
+ id : restore-eslint-cache
145
150
- run : yarn --cwd airflow/www/ install --frozen-lockfile --non-interactive
146
151
- run : yarn --cwd airflow/www/ run test
147
152
env :
148
153
FORCE_COLOR : 2
154
+ - name : " Save eslint cache (www)"
155
+ uses : apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
156
+ with :
157
+ path : ' airflow/www/node_modules/'
158
+ key : ${{ runner.os }}-www-node-modules-${{ hashFiles('airflow/www/**/yarn.lock') }}
159
+ if-no-files-found : ' error'
160
+ retention-days : ' 2'
161
+ if : steps.restore-eslint-cache.outputs.cache-hit != 'true'
162
+
163
+ install-pre-commit :
164
+ timeout-minutes : 5
165
+ name : " Install pre-commit for cache"
166
+ runs-on : ${{ fromJSON(inputs.runs-on-as-json-default) }}
167
+ env :
168
+ PYTHON_MAJOR_MINOR_VERSION : " ${{ inputs.default-python-version }}"
169
+ if : inputs.basic-checks-only == 'true'
170
+ steps :
171
+ - name : " Cleanup repo"
172
+ shell : bash
173
+ run : docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
174
+ - name : " Checkout ${{ github.ref }} ( ${{ github.sha }} )"
175
+ uses : actions/checkout@v4
176
+ with :
177
+ persist-credentials : false
178
+ - name : " Install Breeze"
179
+ uses : ./.github/actions/breeze
180
+ id : breeze
181
+ - name : " Install pre-commit"
182
+ uses : ./.github/actions/install-pre-commit
183
+ id : pre-commit
184
+ with :
185
+ python-version : ${{steps.breeze.outputs.host-python-version}}
186
+ # Saving pre-commit cache should happen only in one job in the entire workflow - because otherwise
187
+ # it will cause 409 conflict errors - see https://github.com/actions/upload-artifact/issues/478
188
+ # the way it works with airflow - even if the same action is in "ci-image-tests" the if condition
189
+ # above `if: inputs.basic-checks-only == 'true'` will prevent it from running in the other job
190
+ - name : " Save pre-commit cache"
191
+ uses : apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
192
+ with :
193
+ # yamllint disable rule:line-length
194
+ key : " pre-commit-cache-${{ steps.breeze.outputs.host-python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}"
195
+ path : ~/.cache/pre-commit/
196
+ if-no-files-found : ' error'
197
+ retention-days : ' 2'
149
198
150
199
# Those checks are run if no image needs to be built for checks. This is for simple changes that
151
200
# Do not touch any of the python code or any of the important files that might require building
@@ -154,6 +203,7 @@ jobs:
154
203
timeout-minutes : 30
155
204
name : " Static checks: basic checks only"
156
205
runs-on : ${{ fromJSON(inputs.runs-on-as-json-public) }}
206
+ needs : install-pre-commit
157
207
if : inputs.basic-checks-only == 'true'
158
208
steps :
159
209
- name : " Cleanup repo"
@@ -165,18 +215,6 @@ jobs:
165
215
persist-credentials : false
166
216
- name : " Cleanup docker"
167
217
run : ./scripts/ci/cleanup_docker.sh
168
- - name : " Setup python"
169
- uses : actions/setup-python@v5
170
- with :
171
- python-version : ${{ inputs.default-python-version }}
172
- cache : ' pip'
173
- cache-dependency-path : ./dev/breeze/pyproject.toml
174
- - name : " Setup python"
175
- uses : actions/setup-python@v5
176
- with :
177
- python-version : " ${{ inputs.default-python-version }}"
178
- cache : ' pip'
179
- cache-dependency-path : ./dev/breeze/pyproject.toml
180
218
- name : " Install Breeze"
181
219
uses : ./.github/actions/breeze
182
220
id : breeze
@@ -216,6 +254,7 @@ jobs:
216
254
timeout-minutes : 45
217
255
name : " Upgrade checks"
218
256
runs-on : ${{ fromJSON(inputs.runs-on-as-json-public) }}
257
+ needs : install-pre-commit
219
258
env :
220
259
PYTHON_MAJOR_MINOR_VERSION : " ${{ inputs.default-python-version }}"
221
260
if : inputs.canary-run == 'true' && inputs.latest-versions-only != 'true'
@@ -229,12 +268,14 @@ jobs:
229
268
persist-credentials : false
230
269
- name : " Cleanup docker"
231
270
run : ./scripts/ci/cleanup_docker.sh
232
- # Install python from scratch. No cache used. We always want to have fresh version of everything
233
- - uses : actions/setup-python@v5
271
+ - name : " Install Breeze"
272
+ uses : ./.github/actions/breeze
273
+ id : breeze
274
+ - name : " Install pre-commit"
275
+ uses : ./.github/actions/install-pre-commit
276
+ id : pre-commit
234
277
with :
235
- python-version : " ${{ inputs.default-python-version }}"
236
- - name : " Install latest pre-commit"
237
- run : pip install pre-commit
278
+ python-version : ${{steps.breeze.outputs.host-python-version}}
238
279
- name : " Autoupdate all pre-commits"
239
280
run : pre-commit autoupdate
240
281
- name : " Run automated upgrade for black"
0 commit comments