-
Notifications
You must be signed in to change notification settings - Fork 963
140 lines (130 loc) · 6.26 KB
/
Copy pathmain-jdk17-build.yml
File metadata and controls
140 lines (130 loc) · 6.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: main jdk17 build
on:
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
# Superseded PR runs are dead work: cancel them. Never cancel a main build --
# that run is the record for a commit that is already merged.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
# Single source of truth for the build/integration-tests shard split: the
# `integration-tests` job runs exactly these modules and the `build` job
# excludes exactly these modules, both derived from this one list.
#
# Do NOT split this into two hand-maintained lists. The dangerous direction is
# silent: a module excluded from `build` but missing from the shard runs
# nowhere, and CI stays green while the tests stop existing.
#
# These six are ~15 of the build's 37 minutes -- five are testcontainers-backed
# (Elasticsearch/OpenSearch/Solr/Kafka/MinIO) and tika-pipes-integration-tests
# forks JVMs. Adding a slow IT module here is the intended way to rebalance.
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'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
java: [ '17' ]
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Install external tools
run: sudo apt-get update && sudo apt-get install -y ffmpeg libimage-exiftool-perl
# Everything except $IT_MODULES, which the integration-tests job owns.
# sed turns each ':artifactId' into the '!:artifactId' exclusion form.
- name: Build with Maven
run: |
mvn clean apache-rat:check test install javadoc:aggregate -Pci \
-pl "$(echo "$IT_MODULES" | sed 's/:/!:/g')" \
-B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 45
# No `needs: build`, same reasoning as e2e-tests below: this job installs the
# reactor itself, so gating on build would only serialize it.
strategy:
matrix:
java: [ '17' ]
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Install external tools
run: sudo apt-get update && sudo apt-get install -y ffmpeg libimage-exiftool-perl
# Full reactor for the same reason as the e2e job: these modules depend on
# the tika-pipes plugin zips, and a zip-type dependency never matches a
# jar-packaging reactor module, so -am cannot supply them. -Pfast keeps it
# to ~3 min; the tests themselves run in the next step.
- name: Install all modules (produces the plugin zips)
run: mvn clean install -Pfast -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
# apache-rat:check here too -- the build job no longer sees these modules,
# so without this they would drop out of license checking entirely.
- name: Run integration tests
run: |
mvn clean apache-rat:check test -Pci \
-pl "$IT_MODULES" \
-B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
e2e-tests:
runs-on: ubuntu-latest
# full-reactor install added; 30 was tight for it
timeout-minutes: 45
# No `needs: build` on purpose: this job checks out and installs the reactor
# itself, so it consumes nothing from `build`. Gating on it only serialized
# ~5 min onto the critical path.
strategy:
matrix:
java: [ '17' ]
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
# Full reactor, not -pl ... -am: the e2e modules need tika-pipes-plugins zips, and a
# zip-type dependency never matches a jar-packaging reactor module, so -am treats every
# plugin zip as external and skips building those modules entirely. install (not verify)
# because the assembly sets attach=false (TIKA-4723) and an install-phase install-file is
# what puts each zip in the local repo. -Pfast (skipTests + rat/checkstyle/spotless
# off) because the build job owns all of that; this job only needs the artifacts.
- name: Install all modules (produces the plugin zips)
run: mvn clean install -Pfast -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
# -pl must name the leaf modules: tika-e2e-tests is an aggregator pom, and Maven does
# not pull in a selected aggregator's children, so this job built two pom-only modules
# and ran zero tests while reporting green.
- name: Run E2E Tests
run: mvn -pl :tika-e2e-tests-server,:tika-grpc-e2e-test clean verify -Pe2e -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"