@@ -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,50 @@ 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}}
149
193
150
194
# Those checks are run if no image needs to be built for checks. This is for simple changes that
151
195
# Do not touch any of the python code or any of the important files that might require building
@@ -154,6 +198,7 @@ jobs:
154
198
timeout-minutes : 30
155
199
name : " Static checks: basic checks only"
156
200
runs-on : ${{ fromJSON(inputs.runs-on-as-json-public) }}
201
+ needs : install-pre-commit
157
202
if : inputs.basic-checks-only == 'true'
158
203
steps :
159
204
- name : " Cleanup repo"
@@ -165,20 +210,10 @@ jobs:
165
210
persist-credentials : false
166
211
- name : " Cleanup docker"
167
212
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
213
- name : " Install Breeze"
181
214
uses : ./.github/actions/breeze
215
+ with :
216
+ use-uv : ${{ inputs.use-uv }}
182
217
id : breeze
183
218
- name : " Install pre-commit"
184
219
uses : ./.github/actions/install-pre-commit
@@ -216,6 +251,7 @@ jobs:
216
251
timeout-minutes : 45
217
252
name : " Upgrade checks"
218
253
runs-on : ${{ fromJSON(inputs.runs-on-as-json-public) }}
254
+ needs : install-pre-commit
219
255
env :
220
256
PYTHON_MAJOR_MINOR_VERSION : " ${{ inputs.default-python-version }}"
221
257
if : inputs.canary-run == 'true' && inputs.latest-versions-only != 'true'
@@ -229,12 +265,16 @@ jobs:
229
265
persist-credentials : false
230
266
- name : " Cleanup docker"
231
267
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
268
+ - name : " Install Breeze"
269
+ uses : ./.github/actions/breeze
270
+ with :
271
+ use-uv : ${{ inputs.use-uv }}
272
+ id : breeze
273
+ - name : " Install pre-commit"
274
+ uses : ./.github/actions/install-pre-commit
275
+ id : pre-commit
234
276
with :
235
- python-version : " ${{ inputs.default-python-version }}"
236
- - name : " Install latest pre-commit"
237
- run : pip install pre-commit
277
+ python-version : ${{steps.breeze.outputs.host-python-version}}
238
278
- name : " Autoupdate all pre-commits"
239
279
run : pre-commit autoupdate
240
280
- name : " Run automated upgrade for black"
@@ -305,6 +345,8 @@ jobs:
305
345
run : ./scripts/ci/cleanup_docker.sh
306
346
- name : " Install Breeze"
307
347
uses : ./.github/actions/breeze
348
+ with :
349
+ use-uv : ${{ inputs.use-uv }}
308
350
- name : " Cleanup dist files"
309
351
run : rm -fv ./dist/*
310
352
- name : Setup git for tagging
0 commit comments