Skip to content

Commit f6f6dae

Browse files
committed
[SPARK-50590][INFRA] Skip uncessary image build and push
### What changes were proposed in this pull request? Skip uncessary image build and push ### Why are the changes needed? for master, the build of `./dev/infra/` is not needed; for branch-3.5, the build of new images is not needed; skip those steps by branch, to make sure right images are used ### Does this PR introduce _any_ user-facing change? no, infra-only ### How was this patch tested? ci ### Was this patch authored or co-authored using generative AI tooling? no Closes #49204 from zhengruifeng/infra_avoid_build. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
1 parent 5ac42e2 commit f6f6dae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/build_and_test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ jobs:
393393
if: >-
394394
fromJson(needs.precondition.outputs.required).pyspark == 'true' ||
395395
fromJson(needs.precondition.outputs.required).lint == 'true' ||
396+
fromJson(needs.precondition.outputs.required).docs == 'true' ||
396397
fromJson(needs.precondition.outputs.required).sparkr == 'true'
397398
runs-on: ubuntu-latest
398399
permissions:
@@ -422,7 +423,8 @@ jobs:
422423
uses: docker/setup-qemu-action@v3
423424
- name: Set up Docker Buildx
424425
uses: docker/setup-buildx-action@v3
425-
- name: Build and push
426+
- name: Build and push for branch-3.5
427+
if: inputs.branch == 'branch-3.5'
426428
id: docker_build
427429
uses: docker/build-push-action@v6
428430
with:
@@ -433,7 +435,7 @@ jobs:
433435
# Use the infra image cache to speed up
434436
cache-from: type=registry,ref=ghcr.io/apache/spark/apache-spark-github-action-image-cache:${{ inputs.branch }}
435437
- name: Build and push (Documentation)
436-
if: hashFiles('dev/spark-test-image/docs/Dockerfile') != ''
438+
if: ${{ inputs.branch != 'branch-3.5' && hashFiles('dev/spark-test-image/docs/Dockerfile') != '' }}
437439
id: docker_build_docs
438440
uses: docker/build-push-action@v6
439441
with:
@@ -444,7 +446,7 @@ jobs:
444446
# Use the infra image cache to speed up
445447
cache-from: type=registry,ref=ghcr.io/apache/spark/apache-spark-github-action-image-docs-cache:${{ inputs.branch }}
446448
- name: Build and push (Linter)
447-
if: hashFiles('dev/spark-test-image/lint/Dockerfile') != ''
449+
if: ${{ inputs.branch != 'branch-3.5' && hashFiles('dev/spark-test-image/lint/Dockerfile') != '' }}
448450
id: docker_build_lint
449451
uses: docker/build-push-action@v6
450452
with:
@@ -455,7 +457,7 @@ jobs:
455457
# Use the infra image cache to speed up
456458
cache-from: type=registry,ref=ghcr.io/apache/spark/apache-spark-github-action-image-lint-cache:${{ inputs.branch }}
457459
- name: Build and push (SparkR)
458-
if: hashFiles('dev/spark-test-image/sparkr/Dockerfile') != ''
460+
if: ${{ inputs.branch != 'branch-3.5' && hashFiles('dev/spark-test-image/sparkr/Dockerfile') != '' }}
459461
id: docker_build_sparkr
460462
uses: docker/build-push-action@v6
461463
with:

0 commit comments

Comments
 (0)