@@ -56,6 +56,10 @@ on: # yamllint disable-line rule:truthy
56
56
description : " Whether to run only latest version checks (true/false)"
57
57
required : true
58
58
type : string
59
+ use-uv :
60
+ description : " Whether to use uv in the image"
61
+ required : true
62
+ type : string
59
63
jobs :
60
64
run-breeze-tests :
61
65
timeout-minutes : 10
@@ -72,16 +76,12 @@ jobs:
72
76
persist-credentials : false
73
77
- name : " Cleanup docker"
74
78
run : ./scripts/ci/cleanup_docker.sh
75
- - uses : actions/setup-python@v5
79
+ - name : " Install Breeze"
80
+ uses : ./.github/actions/breeze
76
81
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
82
+ use-uv : ${{ inputs.use-uv }}
83
+ - run : uv tool run --from apache-airflow-breeze pytest -n auto --color=yes
82
84
working-directory : ./dev/breeze/
83
-
84
-
85
85
tests-ui :
86
86
timeout-minutes : 10
87
87
name : React UI tests
@@ -108,15 +108,24 @@ jobs:
108
108
node-version : 21
109
109
cache : ' pnpm'
110
110
cache-dependency-path : ' airflow/ui/pnpm-lock.yaml'
111
- - name : " Cache eslint"
112
- uses : actions/cache@v4
111
+ - name : " Restore eslint cache (ui) "
112
+ uses : apache/infrastructure- actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
113
113
with :
114
- path : ' airflow/ui/node_modules'
115
- key : ${{ runner.os }}-ui-node-modules-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
114
+ path : airflow/ui/node_modules/
115
+ key : cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
116
+ id : restore-eslint-cache
116
117
- run : cd airflow/ui && pnpm install --frozen-lockfile
117
118
- run : cd airflow/ui && pnpm test
118
119
env :
119
120
FORCE_COLOR : 2
121
+ - name : " Save eslint cache (ui)"
122
+ uses : apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
123
+ with :
124
+ path : airflow/ui/node_modules/
125
+ key : cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
126
+ if-no-files-found : ' error'
127
+ retention-days : ' 2'
128
+ if : steps.restore-eslint-cache.outputs.stash-hit != 'true'
120
129
121
130
tests-www :
122
131
timeout-minutes : 10
@@ -137,15 +146,54 @@ jobs:
137
146
uses : actions/setup-node@v4
138
147
with :
139
148
node-version : 21
140
- - name : " Cache eslint"
141
- uses : actions/cache@v4
149
+ - name : " Restore eslint cache (www) "
150
+ uses : apache/infrastructure- actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
142
151
with :
143
- path : ' airflow/www/node_modules'
144
- key : ${{ runner.os }}-www-node-modules-${{ hashFiles('airflow/www/**/yarn.lock') }}
152
+ path : airflow/www/node_modules/
153
+ key : cache-www-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/www/**/yarn.lock') }}
154
+ id : restore-eslint-cache
145
155
- run : yarn --cwd airflow/www/ install --frozen-lockfile --non-interactive
146
156
- run : yarn --cwd airflow/www/ run test
147
157
env :
148
158
FORCE_COLOR : 2
159
+ - name : " Save eslint cache (www)"
160
+ uses : apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
161
+ with :
162
+ path : airflow/www/node_modules/
163
+ key : cache-www-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/www/**/yarn.lock') }}
164
+ if-no-files-found : ' error'
165
+ retention-days : ' 2'
166
+ if : steps.restore-eslint-cache.outputs.stash-hit != 'true'
167
+
168
+ install-pre-commit :
169
+ timeout-minutes : 5
170
+ name : " Install pre-commit for cache"
171
+ runs-on : ${{ fromJSON(inputs.runs-on-as-json-default) }}
172
+ env :
173
+ PYTHON_MAJOR_MINOR_VERSION : " ${{ inputs.default-python-version }}"
174
+ if : inputs.basic-checks-only == 'true'
175
+ steps :
176
+ - name : " Cleanup repo"
177
+ shell : bash
178
+ run : docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
179
+ - name : " Checkout ${{ github.ref }} ( ${{ github.sha }} )"
180
+ uses : actions/checkout@v4
181
+ with :
182
+ persist-credentials : false
183
+ - name : " Install Breeze"
184
+ uses : ./.github/actions/breeze
185
+ with :
186
+ use-uv : ${{ inputs.use-uv }}
187
+ id : breeze
188
+ - name : " Install pre-commit"
189
+ uses : ./.github/actions/install-pre-commit
190
+ id : pre-commit
191
+ with :
192
+ python-version : ${{steps.breeze.outputs.host-python-version}}
193
+ - name : " Prepare .tar file from pre-commit cache"
194
+ run : |
195
+ tar -C ~ -czf /tmp/cache-pre-commit.tar.gz .cache/pre-commit .cache/uv
196
+ shell : bash
149
197
150
198
# Those checks are run if no image needs to be built for checks. This is for simple changes that
151
199
# Do not touch any of the python code or any of the important files that might require building
@@ -154,6 +202,7 @@ jobs:
154
202
timeout-minutes : 30
155
203
name : " Static checks: basic checks only"
156
204
runs-on : ${{ fromJSON(inputs.runs-on-as-json-public) }}
205
+ needs : install-pre-commit
157
206
if : inputs.basic-checks-only == 'true'
158
207
steps :
159
208
- name : " Cleanup repo"
@@ -165,20 +214,10 @@ jobs:
165
214
persist-credentials : false
166
215
- name : " Cleanup docker"
167
216
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
217
- name : " Install Breeze"
181
218
uses : ./.github/actions/breeze
219
+ with :
220
+ use-uv : ${{ inputs.use-uv }}
182
221
id : breeze
183
222
- name : " Install pre-commit"
184
223
uses : ./.github/actions/install-pre-commit
@@ -216,6 +255,7 @@ jobs:
216
255
timeout-minutes : 45
217
256
name : " Upgrade checks"
218
257
runs-on : ${{ fromJSON(inputs.runs-on-as-json-public) }}
258
+ needs : install-pre-commit
219
259
env :
220
260
PYTHON_MAJOR_MINOR_VERSION : " ${{ inputs.default-python-version }}"
221
261
if : inputs.canary-run == 'true' && inputs.latest-versions-only != 'true'
@@ -229,12 +269,16 @@ jobs:
229
269
persist-credentials : false
230
270
- name : " Cleanup docker"
231
271
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
272
+ - name : " Install Breeze "
273
+ uses : ./.github/ actions/breeze
234
274
with :
235
- python-version : " ${{ inputs.default-python-version }}"
236
- - name : " Install latest pre-commit"
237
- run : pip install pre-commit
275
+ use-uv : ${{ inputs.use-uv }}
276
+ id : breeze
277
+ - name : " Install pre-commit"
278
+ uses : ./.github/actions/install-pre-commit
279
+ id : pre-commit
280
+ with :
281
+ python-version : ${{steps.breeze.outputs.host-python-version}}
238
282
- name : " Autoupdate all pre-commits"
239
283
run : pre-commit autoupdate
240
284
- name : " Run automated upgrade for black"
@@ -305,6 +349,8 @@ jobs:
305
349
run : ./scripts/ci/cleanup_docker.sh
306
350
- name : " Install Breeze"
307
351
uses : ./.github/actions/breeze
352
+ with :
353
+ use-uv : ${{ inputs.use-uv }}
308
354
- name : " Cleanup dist files"
309
355
run : rm -fv ./dist/*
310
356
- name : Setup git for tagging
0 commit comments