Skip to content

Commit f5ebbf9

Browse files
authored
TIKA-4820 -- refactor ci to improve wall clock and environment
TIKA-4820 -- refactor ci to improve wall clock and environment
2 parents 7a79fd2 + 910f08b commit f5ebbf9

5 files changed

Lines changed: 154 additions & 62 deletions

File tree

.github/workflows/main-jdk17-build.yml

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@ on:
2727
paths-ignore:
2828
- 'docs/**'
2929

30+
# Superseded PR runs are dead work: cancel them. Never cancel a main build --
31+
# that run is the record for a commit that is already merged.
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.ref }}
34+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
35+
36+
env:
37+
# Single source of truth for the build/integration-tests shard split: the
38+
# `integration-tests` job runs exactly these modules and the `build` job
39+
# excludes exactly these modules, both derived from this one list.
40+
#
41+
# Do NOT split this into two hand-maintained lists. The dangerous direction is
42+
# silent: a module excluded from `build` but missing from the shard runs
43+
# nowhere, and CI stays green while the tests stop existing.
44+
#
45+
# These six are ~15 of the build's 37 minutes -- five are testcontainers-backed
46+
# (Elasticsearch/OpenSearch/Solr/Kafka/MinIO) and tika-pipes-integration-tests
47+
# forks JVMs. Adding a slow IT module here is the intended way to rebalance.
48+
IT_MODULES: ':tika-pipes-integration-tests,:tika-pipes-es-integration-tests,:tika-pipes-opensearch-integration-tests,:tika-pipes-solr-integration-tests,:tika-pipes-kafka-integration-tests,:tika-pipes-s3-integration-tests'
49+
3050
jobs:
3151
build:
3252
runs-on: ubuntu-latest
@@ -45,14 +65,54 @@ jobs:
4565
cache: 'maven'
4666
- name: Install external tools
4767
run: sudo apt-get update && sudo apt-get install -y ffmpeg libimage-exiftool-perl
68+
# Everything except $IT_MODULES, which the integration-tests job owns.
69+
# sed turns each ':artifactId' into the '!:artifactId' exclusion form.
4870
- name: Build with Maven
49-
run: mvn clean apache-rat:check test install javadoc:aggregate -Pci -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
71+
run: |
72+
mvn clean apache-rat:check test install javadoc:aggregate -Pci \
73+
-pl "$(echo "$IT_MODULES" | sed 's/:/!:/g')" \
74+
-B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
75+
76+
integration-tests:
77+
runs-on: ubuntu-latest
78+
timeout-minutes: 45
79+
# No `needs: build`, same reasoning as e2e-tests below: this job installs the
80+
# reactor itself, so gating on build would only serialize it.
81+
strategy:
82+
matrix:
83+
java: [ '17' ]
84+
85+
steps:
86+
- uses: actions/checkout@v6
87+
- name: Set up JDK ${{ matrix.java }}
88+
uses: actions/setup-java@v5
89+
with:
90+
distribution: 'temurin'
91+
java-version: ${{ matrix.java }}
92+
cache: 'maven'
93+
- name: Install external tools
94+
run: sudo apt-get update && sudo apt-get install -y ffmpeg libimage-exiftool-perl
95+
# Full reactor for the same reason as the e2e job: these modules depend on
96+
# the tika-pipes plugin zips, and a zip-type dependency never matches a
97+
# jar-packaging reactor module, so -am cannot supply them. -Pfast keeps it
98+
# to ~3 min; the tests themselves run in the next step.
99+
- name: Install all modules (produces the plugin zips)
100+
run: mvn clean install -Pfast -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
101+
# apache-rat:check here too -- the build job no longer sees these modules,
102+
# so without this they would drop out of license checking entirely.
103+
- name: Run integration tests
104+
run: |
105+
mvn clean apache-rat:check test -Pci \
106+
-pl "$IT_MODULES" \
107+
-B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
50108
51109
e2e-tests:
52110
runs-on: ubuntu-latest
53111
# full-reactor install added; 30 was tight for it
54112
timeout-minutes: 45
55-
needs: build
113+
# No `needs: build` on purpose: this job checks out and installs the reactor
114+
# itself, so it consumes nothing from `build`. Gating on it only serialized
115+
# ~5 min onto the critical path.
56116
strategy:
57117
matrix:
58118
java: [ '17' ]
@@ -69,9 +129,10 @@ jobs:
69129
# zip-type dependency never matches a jar-packaging reactor module, so -am treats every
70130
# plugin zip as external and skips building those modules entirely. install (not verify)
71131
# because the assembly sets attach=false (TIKA-4723) and an install-phase install-file is
72-
# what puts each zip in the local repo. Tests are skipped here; the build job owns them.
132+
# what puts each zip in the local repo. -Pfast (skipTests + rat/checkstyle/spotless
133+
# off) because the build job owns all of that; this job only needs the artifacts.
73134
- name: Install all modules (produces the plugin zips)
74-
run: mvn clean install -DskipTests -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
135+
run: mvn clean install -Pfast -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
75136
# -pl must name the leaf modules: tika-e2e-tests is an aggregator pom, and Maven does
76137
# not pull in a selected aggregator's children, so this job built two pom-only modules
77138
# and ran zero tests while reporting green.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# 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, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# tr_TR is the highest-value locale to test in Java: dotless-i means
19+
# "TIFF".toLowerCase() is not "tiff" unless the call passes Locale.ROOT.
20+
#
21+
# Linux, not Windows: locale bugs are JVM-level, so the 2x-cost Windows runner
22+
# buys nothing here -- main-jdk17-windows-build covers the OS-specific surface.
23+
#
24+
# Locale via -Duser.language/-Duser.country, not LANG/LC_ALL: the JVM silently
25+
# falls back to en_US when the named locale is not generated on the runner, so
26+
# the env-var form can pass while testing nothing.
27+
#
28+
# push-only, like the jdk21/jdk25 builds: locale regressions are rare and not
29+
# usually PR-specific, so a full reactor build per PR is not worth the cost.
30+
name: main jdk17 locale build (tr_TR)
31+
32+
on:
33+
push:
34+
branches: [ main ]
35+
paths-ignore:
36+
- 'docs/**'
37+
38+
jobs:
39+
build:
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 60
42+
strategy:
43+
matrix:
44+
java: [ '17' ]
45+
46+
steps:
47+
- uses: actions/checkout@v6
48+
- name: Set up JDK ${{ matrix.java }}
49+
uses: actions/setup-java@v5
50+
with:
51+
distribution: 'temurin'
52+
java-version: ${{ matrix.java }}
53+
cache: 'maven'
54+
- name: Install external tools
55+
run: sudo apt-get update && sudo apt-get install -y ffmpeg libimage-exiftool-perl
56+
# The Docker-backed integration tests spin up Elasticsearch/OpenSearch/Solr/Kafka/MinIO
57+
# for ~7.5 min and carry no locale signal, so they are excluded here; the main jdk17
58+
# build runs them. If a new testcontainers module appears, add it to this list --
59+
# forgetting only makes this job slower, it does not weaken it.
60+
- name: Build with Maven (tr_TR locale)
61+
run: |
62+
mvn clean test install -Pci \
63+
-pl '!:tika-pipes-es-integration-tests,!:tika-pipes-kafka-integration-tests,!:tika-pipes-opensearch-integration-tests,!:tika-pipes-s3-integration-tests,!:tika-pipes-solr-integration-tests' \
64+
-Duser.language=tr -Duser.country=TR \
65+
-B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"

.github/workflows/main-jdk17-windows-build-multi-locale.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/main-jdk17-windows-build.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,23 @@
1515
# limitations under the License.
1616
#
1717

18-
name: main jdk17 windows build
18+
# The one Windows job. Two things it uniquely covers:
19+
# - path handling: the checkout dir below deliberately contains a space
20+
# - an alternate (non-en_US) locale
21+
#
22+
# Locale is set with -Duser.language/-Duser.country, NOT LANG/LC_ALL. Those env
23+
# vars are POSIX-only: the Windows JVM reads the OS locale via Win32 and ignores
24+
# them, and even on Linux the JVM silently falls back to en_US when the named
25+
# locale is not generated on the box. -D always applies.
26+
#
27+
# push-only, like the jdk21/jdk25 and tr_TR builds. This is the most expensive
28+
# job in CI -- a full reactor on a 2x-cost runner, ~48 min -- and it gated PR
29+
# wall clock all by itself while every Linux job finished in ~22. Windows-only
30+
# regressions are real but rare, so they are caught on main within the hour
31+
# rather than paid for on every PR push.
32+
name: main jdk17 windows build (de_DE)
1933

2034
on:
21-
pull_request:
22-
branches: [ main ]
23-
paths-ignore:
24-
- 'docs/**'
2535
push:
2636
branches: [ main ]
2737
paths-ignore:
@@ -36,6 +46,7 @@ jobs:
3646
java: [ '17' ]
3747

3848
steps:
49+
# The space in this path is deliberate -- it is what catches path-quoting bugs.
3950
- uses: actions/checkout@v6
4051
with:
4152
path: 'tika build dir'
@@ -45,6 +56,6 @@ jobs:
4556
distribution: 'temurin'
4657
java-version: ${{ matrix.java }}
4758
cache: 'maven'
48-
- name: Build with Maven
59+
- name: Build with Maven (de_DE locale)
4960
working-directory: 'tika build dir'
50-
run: mvn clean test install javadoc:aggregate -Pci -Pe2e -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
61+
run: mvn clean test install javadoc:aggregate -Pci -Pe2e -Duser.language=de -Duser.country=DE -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"

.github/workflows/split-packages.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ on:
2323
push:
2424
branches: [ main ]
2525

26+
# Superseded PR runs are dead work: cancel them. Never cancel a main build --
27+
# that run is the record for a commit that is already merged.
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.ref }}
30+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
31+
2632
jobs:
2733
check-split-packages:
2834
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)