@@ -19,11 +19,8 @@ name: Test
1919
2020on :
2121 push :
22- branches :
23- - ' **'
24- - ' !dependabot/**'
25- tags :
26- - ' **'
22+ branches : [main]
23+ tags : ['**']
2724 pull_request :
2825
2926concurrency :
@@ -32,6 +29,7 @@ concurrency:
3229
3330permissions :
3431 contents : read
32+ pull-requests : read
3533
3634env :
3735 DOCKER_VOLUME_PREFIX : " .docker/"
6664 uses : actions/cache@v5
6765 with :
6866 path : .docker
69- key : maven-${{ matrix.jdk }}-${{ matrix.maven }}-${{ hashFiles('compose.yaml', '**/pom.xml', '**/*.java' ) }}
67+ key : maven-${{ matrix.jdk }}-${{ matrix.maven }}-${{ hashFiles('compose.yaml', '**/pom.xml') }}
7068 restore-keys : maven-${{ matrix.jdk }}-${{ matrix.maven }}-
7169 - name : Execute Docker Build
7270 env :
@@ -94,16 +92,17 @@ jobs:
9492 jdk : 17
9593 macos : latest
9694 steps :
97- - name : Set up Java
98- uses : actions/setup-java@v5
99- with :
100- distribution : ' temurin'
101- java-version : ${{ matrix.jdk }}
10295 - name : Checkout Arrow
10396 uses : actions/checkout@v6
10497 with :
10598 fetch-depth : 0
10699 submodules : recursive
100+ - name : Set up Java
101+ uses : actions/setup-java@v5
102+ with :
103+ distribution : ' temurin'
104+ java-version : ${{ matrix.jdk }}
105+ cache : ' maven'
107106 - name : Build
108107 shell : bash
109108 env :
@@ -125,16 +124,17 @@ jobs:
125124 matrix :
126125 jdk : [17]
127126 steps :
128- - name : Set up Java
129- uses : actions/setup-java@v5
130- with :
131- java-version : ${{ matrix.jdk }}
132- distribution : ' temurin'
133127 - name : Checkout Arrow
134128 uses : actions/checkout@v6
135129 with :
136130 fetch-depth : 0
137131 submodules : recursive
132+ - name : Set up Java
133+ uses : actions/setup-java@v5
134+ with :
135+ java-version : ${{ matrix.jdk }}
136+ distribution : ' temurin'
137+ cache : ' maven'
138138 - name : Build
139139 shell : bash
140140 env :
@@ -149,59 +149,111 @@ jobs:
149149 integration :
150150 name : AMD64 integration
151151 runs-on : ubuntu-latest
152+ if : ${{ !contains(github.event.pull_request.title, 'WIP') }}
152153 timeout-minutes : 60
153154 steps :
155+ - name : Check integration relevance
156+ id : integration-changes
157+ uses : actions/github-script@v8
158+ with :
159+ script : |
160+ if (context.eventName !== 'pull_request') {
161+ core.setOutput('should_run', 'true');
162+ return;
163+ }
164+
165+ const files = await github.paginate(
166+ github.rest.pulls.listFiles,
167+ {
168+ owner: context.repo.owner,
169+ repo: context.repo.repo,
170+ pull_number: context.payload.pull_request.number,
171+ per_page: 100,
172+ }
173+ );
174+
175+ const relevant = files.some(({ filename }) =>
176+ filename === 'compose.yaml' ||
177+ filename === 'pom.xml' ||
178+ filename === '.github/workflows/test.yml' ||
179+ filename.startsWith('c/') ||
180+ filename.startsWith('flight/') ||
181+ filename.startsWith('format/') ||
182+ filename.startsWith('vector/') ||
183+ filename.startsWith('ci/scripts/') ||
184+ filename.startsWith('testing/data/') ||
185+ filename.endsWith('/pom.xml')
186+ );
187+
188+ core.setOutput('should_run', relevant ? 'true' : 'false');
189+ core.notice(
190+ relevant
191+ ? 'Integration-relevant changes detected; running integration tests.'
192+ : 'No integration-relevant changes detected; skipping integration tests.'
193+ );
154194 - name : Checkout Arrow
195+ if : steps.integration-changes.outputs.should_run == 'true'
155196 uses : actions/checkout@v6
156197 with :
157198 fetch-depth : 0
158199 repository : apache/arrow
159200 submodules : recursive
160201 - name : Checkout Arrow Rust
202+ if : steps.integration-changes.outputs.should_run == 'true'
161203 uses : actions/checkout@v6
162204 with :
163205 repository : apache/arrow-rs
164206 path : rust
165207 - name : Checkout Arrow nanoarrow
208+ if : steps.integration-changes.outputs.should_run == 'true'
166209 uses : actions/checkout@v6
167210 with :
168211 repository : apache/arrow-nanoarrow
169212 path : nanoarrow
170213 - name : Checkout Arrow .NET
214+ if : steps.integration-changes.outputs.should_run == 'true'
171215 uses : actions/checkout@v6
172216 with :
173217 repository : apache/arrow-dotnet
174218 path : dotnet
175219 - name : Checkout Arrow Go
220+ if : steps.integration-changes.outputs.should_run == 'true'
176221 uses : actions/checkout@v6
177222 with :
178223 repository : apache/arrow-go
179224 path : go
180225 - name : Checkout Arrow Java
226+ if : steps.integration-changes.outputs.should_run == 'true'
181227 uses : actions/checkout@v6
182228 with :
183229 path : java
184230 - name : Checkout Arrow JavaScript
231+ if : steps.integration-changes.outputs.should_run == 'true'
185232 uses : actions/checkout@v6
186233 with :
187234 repository : apache/arrow-js
188235 path : js
189236 - name : Free up disk space
237+ if : steps.integration-changes.outputs.should_run == 'true'
190238 run : |
191239 ci/scripts/util_free_space.sh
192240 - name : Cache Docker Volumes
241+ if : steps.integration-changes.outputs.should_run == 'true'
193242 uses : actions/cache@v5
194243 with :
195244 path : .docker
196245 key : integration-conda-${{ hashFiles('cpp/**') }}
197246 restore-keys : integration-conda-
198247 - name : Setup Python
248+ if : steps.integration-changes.outputs.should_run == 'true'
199249 uses : actions/setup-python@v6
200250 with :
201251 python-version : 3.12
202252 - name : Setup Archery
253+ if : steps.integration-changes.outputs.should_run == 'true'
203254 run : pip install -e dev/archery[docker]
204255 - name : Execute Docker Build
256+ if : steps.integration-changes.outputs.should_run == 'true'
205257 run : |
206258 source ci/scripts/util_enable_core_dumps.sh
207259 archery docker run \
0 commit comments