Skip to content

Commit df8c84e

Browse files
committed
labeled CI
1 parent da016db commit df8c84e

11 files changed

Lines changed: 152 additions & 134 deletions

.github/workflows/iceberg_spark_test_1_10.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
on:
27+
# PR runs are orchestrated by pr_main.yml, which calls
28+
# iceberg_spark_test_reusable.yml directly with the same parameters.
2729
push:
2830
branches:
2931
- main
@@ -45,25 +47,6 @@ on:
4547
- ".github/workflows/iceberg_spark_test_reusable.yml"
4648
- ".github/actions/setup-builder/**"
4749
- ".github/actions/setup-iceberg-builder/**"
48-
pull_request:
49-
paths:
50-
- "native/**/src/**"
51-
- "native/**/Cargo.toml"
52-
- "native/Cargo.lock"
53-
- "!native/hdfs/**"
54-
- "!native/fs-hdfs/**"
55-
- "common/src/main/**"
56-
- "common/pom.xml"
57-
- "spark/src/main/**"
58-
- "!spark/src/main/scala/org/apache/comet/GenerateDocs.scala"
59-
- "spark/pom.xml"
60-
- "dev/diffs/iceberg/**"
61-
- "pom.xml"
62-
- "rust-toolchain.toml"
63-
- ".github/workflows/iceberg_spark_test_1_10.yml"
64-
- ".github/workflows/iceberg_spark_test_reusable.yml"
65-
- ".github/actions/setup-builder/**"
66-
- ".github/actions/setup-iceberg-builder/**"
6750
workflow_dispatch:
6851

6952
jobs:

.github/workflows/pr_benchmark_check.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,16 @@ concurrency:
2525
cancel-in-progress: true
2626

2727
on:
28+
# PR runs are orchestrated by pr_main.yml (label-gated). Direct triggers
29+
# below cover push to main and manual dispatch.
2830
push:
2931
branches:
3032
- main
3133
paths:
3234
- "native/core/benches/**"
3335
- "native/spark-expr/benches/**"
3436
- "spark/src/test/scala/org/apache/spark/sql/benchmark/**"
35-
pull_request:
36-
paths:
37-
- "native/core/benches/**"
38-
- "native/spark-expr/benches/**"
39-
- "spark/src/test/scala/org/apache/spark/sql/benchmark/**"
37+
workflow_call:
4038
workflow_dispatch:
4139

4240
env:

.github/workflows/pr_build_linux.yml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
on:
25-
# Allow-list of paths that affect this workflow. A change must match a positive
26-
# pattern (and not a trailing "!" exclusion) for the build to run. Editing
27-
# pr_build_macos.yml does not trigger this workflow, and vice versa.
25+
# PR runs are orchestrated by pr_main.yml (label-gated). This file is
26+
# invoked from there via workflow_call. Direct triggers below cover push
27+
# to main and manual dispatch.
2828
push:
2929
branches:
3030
- main
@@ -49,30 +49,7 @@ on:
4949
- "!native/spark-expr/benches/**"
5050
- "!spark/src/test/scala/org/apache/spark/sql/benchmark/**"
5151
- "!spark/src/main/scala/org/apache/comet/GenerateDocs.scala"
52-
pull_request:
53-
paths:
54-
- "native/**"
55-
- "common/**"
56-
- "spark/**"
57-
- "spark-integration/**"
58-
- "pom.xml"
59-
- "**/pom.xml"
60-
- ".mvn/**"
61-
- "mvnw"
62-
- "Makefile"
63-
- "rust-toolchain.toml"
64-
- "dev/ci/**"
65-
- ".github/workflows/pr_build_linux.yml"
66-
- ".github/actions/setup-builder/**"
67-
- ".github/actions/java-test/**"
68-
- ".github/actions/rust-test/**"
69-
- "!**.md"
70-
- "!native/core/benches/**"
71-
- "!native/spark-expr/benches/**"
72-
- "!spark/src/test/scala/org/apache/spark/sql/benchmark/**"
73-
- "!spark/src/main/scala/org/apache/comet/GenerateDocs.scala"
74-
# manual trigger
75-
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
52+
workflow_call:
7653
workflow_dispatch:
7754

7855
env:

.github/workflows/pr_build_macos.yml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
on:
25-
# Allow-list of paths that affect this workflow. A change must match a positive
26-
# pattern (and not a trailing "!" exclusion) for the build to run. Editing
27-
# pr_build_linux.yml does not trigger this workflow, and vice versa.
25+
# PR runs are orchestrated by pr_main.yml (label-gated). This file is
26+
# invoked from there via workflow_call. Direct triggers below cover push
27+
# to main and manual dispatch.
2828
push:
2929
branches:
3030
- main
@@ -48,29 +48,7 @@ on:
4848
- "!native/spark-expr/benches/**"
4949
- "!spark/src/test/scala/org/apache/spark/sql/benchmark/**"
5050
- "!spark/src/main/scala/org/apache/comet/GenerateDocs.scala"
51-
pull_request:
52-
paths:
53-
- "native/**"
54-
- "common/**"
55-
- "spark/**"
56-
- "spark-integration/**"
57-
- "pom.xml"
58-
- "**/pom.xml"
59-
- ".mvn/**"
60-
- "mvnw"
61-
- "Makefile"
62-
- "rust-toolchain.toml"
63-
- "dev/ci/**"
64-
- ".github/workflows/pr_build_macos.yml"
65-
- ".github/actions/setup-macos-builder/**"
66-
- ".github/actions/java-test/**"
67-
- "!**.md"
68-
- "!native/core/benches/**"
69-
- "!native/spark-expr/benches/**"
70-
- "!spark/src/test/scala/org/apache/spark/sql/benchmark/**"
71-
- "!spark/src/main/scala/org/apache/comet/GenerateDocs.scala"
72-
# manual trigger
73-
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
51+
workflow_call:
7452
workflow_dispatch:
7553

7654
env:

.github/workflows/pr_main.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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

.github/workflows/pr_markdown_format.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
on:
25-
pull_request:
26-
paths:
27-
- '**.md'
25+
# PR runs are orchestrated by pr_main.yml (label-gated).
26+
workflow_call:
27+
workflow_dispatch:
2828

2929
jobs:
3030
prettier-check:

.github/workflows/pr_missing_suites.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
on:
25+
# PR runs are orchestrated by pr_main.yml (label-gated). Direct triggers
26+
# below cover push to main and manual dispatch.
2527
push:
2628
branches:
2729
- main
28-
pull_request:
29-
types: [opened, synchronize, reopened]
30+
workflow_call:
31+
workflow_dispatch:
3032

3133
jobs:
3234
check-missing-suites:

.github/workflows/pr_rat_check.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ concurrency:
2424
permissions:
2525
contents: read
2626

27-
# No paths-ignore: this workflow must run for ALL changes including docs
27+
# PR runs are orchestrated by pr_main.yml (label-gated). Direct triggers
28+
# below cover push to main and manual dispatch.
2829
on:
2930
push:
3031
branches:
3132
- main
32-
pull_request:
33+
workflow_call:
3334
workflow_dispatch:
3435

3536
jobs:

.github/workflows/pr_title_check.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
on:
25-
pull_request:
26-
types: [opened, edited, reopened]
25+
# PR runs are orchestrated by pr_main.yml (label-gated). pr_main passes
26+
# through the `edited` PR event so title changes trigger re-validation.
27+
workflow_call:
28+
workflow_dispatch:
2729

2830
jobs:
2931
check-pr-title:

.github/workflows/spark_sql_test_3_5.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ concurrency:
2323
cancel-in-progress: true
2424

2525
on:
26+
# PR runs are orchestrated by pr_main.yml, which calls
27+
# spark_sql_test_reusable.yml directly with the same parameters.
2628
push:
2729
branches:
2830
- main
@@ -49,30 +51,6 @@ on:
4951
- ".github/workflows/spark_sql_test_reusable.yml"
5052
- ".github/actions/setup-builder/**"
5153
- ".github/actions/setup-spark-builder/**"
52-
pull_request:
53-
paths:
54-
- "native/**/src/**"
55-
- "native/**/Cargo.toml"
56-
- "native/Cargo.lock"
57-
- "!native/hdfs/**"
58-
- "!native/fs-hdfs/**"
59-
- "common/src/main/**"
60-
- "common/pom.xml"
61-
- "spark/src/main/**"
62-
- "!spark/src/main/spark-3.4/**"
63-
- "!spark/src/main/spark-4.0/**"
64-
- "!spark/src/main/spark-4.1/**"
65-
- "!spark/src/main/spark-4.2/**"
66-
- "!spark/src/main/spark-4.x/**"
67-
- "!spark/src/main/scala/org/apache/comet/GenerateDocs.scala"
68-
- "spark/pom.xml"
69-
- "dev/diffs/3.5.8.diff"
70-
- "pom.xml"
71-
- "rust-toolchain.toml"
72-
- ".github/workflows/spark_sql_test_3_5.yml"
73-
- ".github/workflows/spark_sql_test_reusable.yml"
74-
- ".github/actions/setup-builder/**"
75-
- ".github/actions/setup-spark-builder/**"
7654
workflow_dispatch:
7755
inputs:
7856
collect-fallback-logs:

0 commit comments

Comments
 (0)