diff --git a/.github/actions/get-target-branch-build-scripts/action.yml b/.github/actions/get-target-branch-build-scripts/action.yml deleted file mode 100644 index 2946a5b2d3636..0000000000000 --- a/.github/actions/get-target-branch-build-scripts/action.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -name: 'Gets target branch build scripts' -runs: - using: "composite" - steps: - - name: Checkout target branch to 'target-airflow' folder to use ci/scripts and breeze from there. - uses: actions/checkout@v3 - with: - path: "target-airflow" - ref: ${{ github.base_ref }} - persist-credentials: false - submodules: recursive - - name: > - Override "scripts/ci", "dev" and "./github/actions" with the target branch - so that the PR does not override it - # We should not override those scripts which become part of the image as they will not be - # changed in the image built - we should only override those that are executed to build - # the image. - shell: bash - run: | - rm -rfv "scripts/ci" - mv -v "target-airflow/scripts/ci" "scripts" - rm -rfv "dev" - mv -v "target-airflow/dev" "." - rm -rfv ".github/actions" - mv -v "target-airflow/.github/actions" ".github" diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 0de707561c774..981f13abbdb15 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -140,8 +140,27 @@ jobs: # Stdout is redirected to GITHUB_ENV but we also print it to stderr to see it in ci log print(output, file=sys.stderr) EOF - - name: "Get target branch build scripts" - uses: ./.github/actions/get-target-branch-build-scripts + - name: Checkout target branch to 'target-airflow' folder to use ci/scripts and breeze from there. + uses: actions/checkout@v3 + with: + path: "target-airflow" + ref: ${{ github.base_ref }} + persist-credentials: false + submodules: recursive + - name: > + Override "scripts/ci", "dev" and ".github/actions" with the target branch + so that the PR does not override it + # We should not override those scripts which become part of the image as they will not be + # changed in the image built - we should only override those that are executed to build + # the image. + shell: bash + run: | + rm -rfv "scripts/ci" + mv -v "target-airflow/scripts/ci" "scripts" + rm -rfv "dev" + mv -v "target-airflow/dev" "." + rm -rfv ".github/actions" + mv -v "target-airflow/.github/actions" ".github" - name: "Install Breeze" uses: ./.github/actions/breeze - name: Selective checks @@ -184,8 +203,27 @@ jobs: ref: ${{ needs.build-info.outputs.target-commit-sha }} persist-credentials: false submodules: recursive - - name: "Get target branch build scripts" - uses: ./.github/actions/get-target-branch-build-scripts + - name: Checkout target branch to 'target-airflow' folder to use ci/scripts and breeze from there. + uses: actions/checkout@v3 + with: + path: "target-airflow" + ref: ${{ github.base_ref }} + persist-credentials: false + submodules: recursive + - name: > + Override "scripts/ci", "dev" and ".github/actions" with the target branch + so that the PR does not override it + # We should not override those scripts which become part of the image as they will not be + # changed in the image built - we should only override those that are executed to build + # the image. + shell: bash + run: | + rm -rfv "scripts/ci" + mv -v "target-airflow/scripts/ci" "scripts" + rm -rfv "dev" + mv -v "target-airflow/dev" "." + rm -rfv ".github/actions" + mv -v "target-airflow/.github/actions" ".github" - name: > Build CI Images ${{needs.build-info.outputs.all-python-versions-list-as-string}}:${{env.IMAGE_TAG}} uses: ./.github/actions/build-ci-images @@ -224,8 +262,27 @@ jobs: ref: ${{ needs.build-info.outputs.target-commit-sha }} persist-credentials: false submodules: recursive - - name: "Get target branch build scripts" - uses: ./.github/actions/get-target-branch-build-scripts + - name: Checkout target branch to 'target-airflow' folder to use ci/scripts and breeze from there. + uses: actions/checkout@v3 + with: + path: "target-airflow" + ref: ${{ github.base_ref }} + persist-credentials: false + submodules: recursive + - name: > + Override "scripts/ci", "dev" and ".github/actions" with the target branch + so that the PR does not override it + # We should not override those scripts which become part of the image as they will not be + # changed in the image built - we should only override those that are executed to build + # the image. + shell: bash + run: | + rm -rfv "scripts/ci" + mv -v "target-airflow/scripts/ci" "scripts" + rm -rfv "dev" + mv -v "target-airflow/dev" "." + rm -rfv ".github/actions" + mv -v "target-airflow/.github/actions" ".github" - name: > Build PROD Images ${{needs.build-info.outputs.all-python-versions-list-as-string}}:${{env.IMAGE_TAG}} @@ -264,8 +321,27 @@ jobs: ref: ${{ needs.build-info.outputs.target-commit-sha }} persist-credentials: false submodules: recursive - - name: "Get target branch build scripts" - uses: ./.github/actions/get-target-branch-build-scripts + - name: Checkout target branch to 'target-airflow' folder to use ci/scripts and breeze from there. + uses: actions/checkout@v3 + with: + path: "target-airflow" + ref: ${{ github.base_ref }} + persist-credentials: false + submodules: recursive + - name: > + Override "scripts/ci", "dev" and ".github/actions" with the target branch + so that the PR does not override it + # We should not override those scripts which become part of the image as they will not be + # changed in the image built - we should only override those that are executed to build + # the image. + shell: bash + run: | + rm -rfv "scripts/ci" + mv -v "target-airflow/scripts/ci" "scripts" + rm -rfv "dev" + mv -v "target-airflow/dev" "." + rm -rfv ".github/actions" + mv -v "target-airflow/.github/actions" ".github" - name: "Start ARM instance" run: ./scripts/ci/images/ci_start_arm_instance_and_connect_to_docker.sh - name: "Install Breeze"