@@ -110,20 +110,21 @@ jobs:
110110
111111 # 4. Check for source code changes (anything not .md and not .ipynb)
112112 if echo "$CHANGED_FILES" | grep -v -E '\.(md|ipynb)$' > /dev/null; then
113- echo "Source code changed, enabling unit tests."
113+ echo "Source code changed, enabling unit tests and notebooks ."
114114 echo "run_tests=true" >> $GITHUB_OUTPUT
115+ echo "run_notebooks=true" >> $GITHUB_OUTPUT
115116 else
116117 echo "No source code changes (only notebook/doc), skipping unit tests."
117118 echo "run_tests=false" >> $GITHUB_OUTPUT
118- fi
119119
120- # 5. Check for notebook (.ipynb) changes
121- if echo "$CHANGED_FILES" | grep '\.ipynb$' > /dev/null; then
122- echo "Notebook files changed, enabling notebook run."
123- echo "run_notebooks=true" >> $GITHUB_OUTPUT
124- else
125- echo "No notebook changes, skipping notebook run."
126- echo "run_notebooks=false" >> $GITHUB_OUTPUT
120+ # 5. Check for notebook (.ipynb) changes
121+ if echo "$CHANGED_FILES" | grep '\.ipynb$' > /dev/null; then
122+ echo "Notebook files changed, enabling notebook run."
123+ echo "run_notebooks=true" >> $GITHUB_OUTPUT
124+ else
125+ echo "No notebook changes, skipping notebook run."
126+ echo "run_notebooks=false" >> $GITHUB_OUTPUT
127+ fi
127128 fi
128129
129130 code_quality_check :
@@ -151,8 +152,11 @@ jobs:
151152 maxtext_sha : ${{ inputs.maxtext_sha || github.sha }}
152153
153154 maxtext_jupyter_notebooks :
154- needs : build_and_upload_maxtext_package
155- if : needs.analyze_code_changes.outputs.run_notebooks == 'true'
155+ needs : [analyze_code_changes, build_and_upload_maxtext_package]
156+ if : |
157+ always() &&
158+ needs.analyze_code_changes.outputs.run_notebooks == 'true' &&
159+ needs.build_and_upload_maxtext_package.result == 'success'
156160 uses : ./.github/workflows/run_jupyter_notebooks.yml
157161 strategy :
158162 fail-fast : false
@@ -176,6 +180,7 @@ jobs:
176180 outputs :
177181 total_workers : ${{ steps.set-params.outputs.total_workers }}
178182 worker_groups : ${{ steps.set-params.outputs.worker_groups }}
183+ maxtext_sha : ${{ needs.build_and_upload_maxtext_package.outputs.maxtext_sha }}
179184 steps :
180185 - id : set-params
181186 name : Formalize Test Suite Parameters
@@ -187,7 +192,10 @@ jobs:
187192
188193 tpu-tests :
189194 name : ${{ matrix.flavor || 'TPU' }} tests
190- needs : [build_and_upload_maxtext_package, gate_test_run]
195+ needs : [gate_test_run]
196+ if : |
197+ always() &&
198+ needs.gate_test_run.result == 'success'
191199 uses : ./.github/workflows/run_tests_coordinator.yml
192200 strategy :
193201 fail-fast : false
@@ -197,23 +205,28 @@ jobs:
197205 flavor : ${{ matrix.flavor }}
198206 base_image : maxtext-unit-test-tpu:py312
199207 is_scheduled_run : ${{ github.event_name == 'schedule' }}
200- maxtext_sha : ${{ needs.build_and_upload_maxtext_package .outputs.maxtext_sha }}
208+ maxtext_sha : ${{ needs.gate_test_run .outputs.maxtext_sha }}
201209
202210 maxtext_cpu_torch_reference_tests :
203211 name : cpu-torch-reference tests
204- needs : [build_and_upload_maxtext_package]
205- if : needs.analyze_code_changes.outputs.run_tests == 'true'
212+ needs : [gate_test_run]
213+ if : |
214+ always() &&
215+ needs.gate_test_run.result == 'success'
206216 uses : ./.github/workflows/run_tests_coordinator.yml
207217 with :
208218 flavor : cpu-torch-reference
209219 base_image : maxtext-unit-test-tpu:py312
210220 is_scheduled_run : ${{ github.event_name == 'schedule' }}
211- maxtext_sha : ${{ needs.build_and_upload_maxtext_package .outputs.maxtext_sha }}
221+ maxtext_sha : ${{ needs.gate_test_run .outputs.maxtext_sha }}
212222
213223 tpu7x-tests :
214224 name : TPU7X tests
215- needs : [build_and_upload_maxtext_package, gate_test_run]
216- if : github.ref == 'refs/heads/main' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
225+ needs : [gate_test_run]
226+ if : |
227+ always() &&
228+ needs.gate_test_run.result == 'success' &&
229+ github.ref == 'refs/heads/main' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
217230 uses : ./.github/workflows/run_tests_coordinator.yml
218231 strategy :
219232 fail-fast : false
@@ -223,11 +236,14 @@ jobs:
223236 flavor : ${{ matrix.flavor }}
224237 base_image : maxtext-unit-test-tpu:py312
225238 is_scheduled_run : ${{ github.event_name == 'schedule' }}
226- maxtext_sha : ${{ needs.build_and_upload_maxtext_package .outputs.maxtext_sha }}
239+ maxtext_sha : ${{ needs.gate_test_run .outputs.maxtext_sha }}
227240
228241 gpu-tests :
229242 name : ${{ matrix.flavor || 'GPU' }} tests
230- needs : [build_and_upload_maxtext_package, gate_test_run]
243+ needs : [gate_test_run]
244+ if : |
245+ always() &&
246+ needs.gate_test_run.result == 'success'
231247 strategy :
232248 fail-fast : false
233249 matrix :
@@ -237,11 +253,14 @@ jobs:
237253 flavor : ${{ matrix.flavor }}
238254 base_image : maxtext-unit-test-cuda12:py312
239255 is_scheduled_run : ${{ github.event_name == 'schedule' }}
240- maxtext_sha : ${{ needs.build_and_upload_maxtext_package .outputs.maxtext_sha }}
256+ maxtext_sha : ${{ needs.gate_test_run .outputs.maxtext_sha }}
241257
242258 cpu-tests :
243259 name : ${{ matrix.flavor || 'CPU' }} tests
244- needs : [build_and_upload_maxtext_package, gate_test_run]
260+ needs : [gate_test_run]
261+ if : |
262+ always() &&
263+ needs.gate_test_run.result == 'success'
245264 uses : ./.github/workflows/run_tests_coordinator.yml
246265 strategy :
247266 fail-fast : false
@@ -251,10 +270,13 @@ jobs:
251270 flavor : ${{ matrix.flavor }}
252271 base_image : maxtext-unit-test-tpu:py312
253272 is_scheduled_run : ${{ github.event_name == 'schedule' }}
254- maxtext_sha : ${{ needs.build_and_upload_maxtext_package .outputs.maxtext_sha }}
273+ maxtext_sha : ${{ needs.gate_test_run .outputs.maxtext_sha }}
255274
256275 maxtext_tpu_pathways_unit_tests :
257- needs : [build_and_upload_maxtext_package, gate_test_run]
276+ needs : [gate_test_run]
277+ if : |
278+ always() &&
279+ needs.gate_test_run.result == 'success'
258280 uses : ./.github/workflows/run_pathways_tests.yml
259281 strategy :
260282 fail-fast : false
@@ -271,12 +293,15 @@ jobs:
271293 tf_force_gpu_allow_growth : false
272294 container_resource_option : " --privileged"
273295 is_scheduled_run : ${{ github.event_name == 'schedule' }}
274- maxtext_sha : ${{ needs.build_and_upload_maxtext_package .outputs.maxtext_sha }}
296+ maxtext_sha : ${{ needs.gate_test_run .outputs.maxtext_sha }}
275297 total_workers : ${{ needs.gate_test_run.outputs.total_workers || '2' }}
276298 worker_group : ${{ matrix.group }}
277299
278300 maxtext_tpu_pathways_integration_tests :
279- needs : [build_and_upload_maxtext_package, gate_test_run]
301+ needs : [gate_test_run]
302+ if : |
303+ always() &&
304+ needs.gate_test_run.result == 'success'
280305 uses : ./.github/workflows/run_pathways_tests.yml
281306 strategy :
282307 fail-fast : false
@@ -291,7 +316,7 @@ jobs:
291316 tf_force_gpu_allow_growth : false
292317 container_resource_option : " --privileged"
293318 is_scheduled_run : ${{ github.event_name == 'schedule' }}
294- maxtext_sha : ${{ needs.build_and_upload_maxtext_package .outputs.maxtext_sha }}
319+ maxtext_sha : ${{ needs.gate_test_run .outputs.maxtext_sha }}
295320
296321 all_tests_passed :
297322 name : All Required Tests Passed
0 commit comments