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+
3050jobs :
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.
0 commit comments