Skip to content

Commit

Permalink
[SPARK-50590][INFRA] Skip uncessary image build and push
Browse files Browse the repository at this point in the history
### 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 <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
  • Loading branch information
zhengruifeng committed Dec 23, 2024
1 parent 5ac42e2 commit f6f6dae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ jobs:
if: >-
fromJson(needs.precondition.outputs.required).pyspark == 'true' ||
fromJson(needs.precondition.outputs.required).lint == 'true' ||
fromJson(needs.precondition.outputs.required).docs == 'true' ||
fromJson(needs.precondition.outputs.required).sparkr == 'true'
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -422,7 +423,8 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
- name: Build and push for branch-3.5
if: inputs.branch == 'branch-3.5'
id: docker_build
uses: docker/build-push-action@v6
with:
Expand All @@ -433,7 +435,7 @@ jobs:
# Use the infra image cache to speed up
cache-from: type=registry,ref=ghcr.io/apache/spark/apache-spark-github-action-image-cache:${{ inputs.branch }}
- name: Build and push (Documentation)
if: hashFiles('dev/spark-test-image/docs/Dockerfile') != ''
if: ${{ inputs.branch != 'branch-3.5' && hashFiles('dev/spark-test-image/docs/Dockerfile') != '' }}
id: docker_build_docs
uses: docker/build-push-action@v6
with:
Expand All @@ -444,7 +446,7 @@ jobs:
# Use the infra image cache to speed up
cache-from: type=registry,ref=ghcr.io/apache/spark/apache-spark-github-action-image-docs-cache:${{ inputs.branch }}
- name: Build and push (Linter)
if: hashFiles('dev/spark-test-image/lint/Dockerfile') != ''
if: ${{ inputs.branch != 'branch-3.5' && hashFiles('dev/spark-test-image/lint/Dockerfile') != '' }}
id: docker_build_lint
uses: docker/build-push-action@v6
with:
Expand All @@ -455,7 +457,7 @@ jobs:
# Use the infra image cache to speed up
cache-from: type=registry,ref=ghcr.io/apache/spark/apache-spark-github-action-image-lint-cache:${{ inputs.branch }}
- name: Build and push (SparkR)
if: hashFiles('dev/spark-test-image/sparkr/Dockerfile') != ''
if: ${{ inputs.branch != 'branch-3.5' && hashFiles('dev/spark-test-image/sparkr/Dockerfile') != '' }}
id: docker_build_sparkr
uses: docker/build-push-action@v6
with:
Expand Down

0 comments on commit f6f6dae

Please sign in to comment.