|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +# Single PR entrypoint. The `gate` job checks for the `CI Ready` label and |
| 19 | +# either fans out to all orchestrated workflows or short-circuits. Push to |
| 20 | +# main and on-demand label-gated workflows (Spark 3.4 / 4.1) bypass this |
| 21 | +# file and trigger their workflows directly. |
| 22 | +name: PR Main |
| 23 | + |
| 24 | +concurrency: |
| 25 | + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +on: |
| 29 | + pull_request: |
| 30 | + # `labeled` covers the moment a committer adds `CI Ready`. |
| 31 | + # `synchronize` re-runs on every push to an already-labeled PR. |
| 32 | + # `edited` re-runs the title check when a contributor edits the PR title. |
| 33 | + types: [opened, synchronize, reopened, labeled, edited] |
| 34 | + workflow_dispatch: |
| 35 | + |
| 36 | +jobs: |
| 37 | + gate: |
| 38 | + name: Gate |
| 39 | + runs-on: ubuntu-latest |
| 40 | + outputs: |
| 41 | + run: ${{ steps.check.outputs.run }} |
| 42 | + steps: |
| 43 | + - id: check |
| 44 | + env: |
| 45 | + EVENT: ${{ github.event_name }} |
| 46 | + HAS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'CI Ready') }} |
| 47 | + run: | |
| 48 | + if [[ "$EVENT" == "workflow_dispatch" ]]; then |
| 49 | + echo "run=true" >> "$GITHUB_OUTPUT" |
| 50 | + echo "::notice::Manual dispatch — bypassing label gate." |
| 51 | + elif [[ "$HAS_LABEL" == "true" ]]; then |
| 52 | + echo "run=true" >> "$GITHUB_OUTPUT" |
| 53 | + echo "::notice::PR has 'CI Ready' label — running all checks." |
| 54 | + else |
| 55 | + echo "run=false" >> "$GITHUB_OUTPUT" |
| 56 | + echo "::notice::Add the 'CI Ready' label to run CI checks." |
| 57 | + fi |
| 58 | +
|
| 59 | + build-linux: |
| 60 | + needs: gate |
| 61 | + if: needs.gate.outputs.run == 'true' |
| 62 | + uses: ./.github/workflows/pr_build_linux.yml |
| 63 | + |
| 64 | + build-macos: |
| 65 | + needs: gate |
| 66 | + if: needs.gate.outputs.run == 'true' |
| 67 | + uses: ./.github/workflows/pr_build_macos.yml |
| 68 | + |
| 69 | + benchmark-check: |
| 70 | + needs: gate |
| 71 | + if: needs.gate.outputs.run == 'true' |
| 72 | + uses: ./.github/workflows/pr_benchmark_check.yml |
| 73 | + |
| 74 | + markdown-format: |
| 75 | + needs: gate |
| 76 | + if: needs.gate.outputs.run == 'true' |
| 77 | + uses: ./.github/workflows/pr_markdown_format.yml |
| 78 | + |
| 79 | + missing-suites: |
| 80 | + needs: gate |
| 81 | + if: needs.gate.outputs.run == 'true' |
| 82 | + uses: ./.github/workflows/pr_missing_suites.yml |
| 83 | + |
| 84 | + rat-check: |
| 85 | + needs: gate |
| 86 | + if: needs.gate.outputs.run == 'true' |
| 87 | + uses: ./.github/workflows/pr_rat_check.yml |
| 88 | + |
| 89 | + title-check: |
| 90 | + needs: gate |
| 91 | + if: needs.gate.outputs.run == 'true' |
| 92 | + uses: ./.github/workflows/pr_title_check.yml |
| 93 | + |
| 94 | + spark-sql-3-5: |
| 95 | + needs: gate |
| 96 | + if: needs.gate.outputs.run == 'true' |
| 97 | + uses: ./.github/workflows/spark_sql_test_reusable.yml |
| 98 | + with: |
| 99 | + spark-short: '3.5' |
| 100 | + spark-full: '3.5.8' |
| 101 | + java: 11 |
| 102 | + |
| 103 | + spark-sql-4-0: |
| 104 | + needs: gate |
| 105 | + if: needs.gate.outputs.run == 'true' |
| 106 | + uses: ./.github/workflows/spark_sql_test_reusable.yml |
| 107 | + with: |
| 108 | + spark-short: '4.0' |
| 109 | + spark-full: '4.0.2' |
| 110 | + java: 21 |
| 111 | + |
| 112 | + iceberg-1-10: |
| 113 | + needs: gate |
| 114 | + if: needs.gate.outputs.run == 'true' |
| 115 | + uses: ./.github/workflows/iceberg_spark_test_reusable.yml |
| 116 | + with: |
| 117 | + iceberg-short: '1.10' |
| 118 | + iceberg-full: '1.10.0' |
| 119 | + spark-short: '3.5' |
| 120 | + spark-full: '3.5.8' |
| 121 | + java: 17 |
0 commit comments