-
Notifications
You must be signed in to change notification settings - Fork 12
241 lines (206 loc) · 6.12 KB
/
build.yml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: Build
on:
workflow_dispatch:
push:
branches:
- "main"
- "3.5.x"
- "3.2.x"
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- '*.md'
- '*.adoc'
- '*.txt'
- '.all-contributorsrc'
pull_request:
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- '*.md'
- '*.adoc'
- '*.txt'
- '.all-contributorsrc'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
upload-pr-number:
runs-on: ubuntu-latest
steps:
- name: Get
id: get-pr-number
if: ${{ always() && github.event_name == 'pull_request' }}
run: |
echo "${{ github.event.number }}" > "pr-number.txt"
- name: Upload
uses: actions/upload-artifact@v4
if: ${{ always() && github.event_name == 'pull_request' }}
with:
name: pr-number
path: pr-number.txt
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Generate Matrix
id: generate-matrix
run: |
root=$(pwd)/integration-tests
pom_file=pom.xml
exclude_dir_pattern=common
exclude_package_type=pom
mapfile -t candidates < <(
find "${root}" -type f -name "${pom_file}" \
| sed "s|/${pom_file}$||" \
| sort \
| uniq)
results=()
for candidate in "${candidates[@]}"
do
if [[ "${candidate}" = "${root}" || "${candidate}" =~ ${exclude_dir_pattern} ]]
then
continue
fi
pom_packaging=0
grep --quiet \
"<packaging>${exclude_package_type}</packaging>" \
"${candidate}/${pom_file}" \
|| pom_packaging="${?}"
if [[ "${pom_packaging}" -ne 0 ]]
then
results+=("${candidate}")
fi
done
matrix=$( \
echo "${results[@]}" \
| tr " " "\n" \
| sed "s|$(pwd)/||" \
| jq \
--raw-input \
--null-input \
--compact-output \
"[ [inputs][] | { \"integration-test-module\": . } ] | { \"include\": . }")
echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
- name: Cancel Build
if: ${{ failure() }}
uses: andymckay/[email protected]
populate-cache:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
id: setup
- name: Populate Maven Cache
id: populate
if: ${{ steps.setup.outputs.cache-hit != 'true' }}
run: |
./mvnw \
--batch-mode \
--define maven.buildNumber.skip \
quarkus:go-offline \
de.qaware.maven:go-offline-maven-plugin:resolve-dependencies
- name: Cancel Build
if: ${{ failure() }}
uses: andymckay/[email protected]
build-and-test-jvm:
runs-on: ubuntu-latest
continue-on-error: true
needs:
- generate-matrix
- populate-cache
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Build and Test
id: build-and-test-jvm
run: |
artifact_path=${{ matrix.integration-test-module }}
./mvnw \
--batch-mode \
--also-make \
--define no-format \
--define maven.buildNumber.skip \
--projects \
"core/deployment, \
jms/deployment, \
ra/deployment, \
${artifact_path}" \
verify
echo "artifact_suffix=${artifact_path//\//_}" >> "${GITHUB_OUTPUT}"
- name: Upload JVM Test Report
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-report-jvm-${{ steps.build-and-test-jvm.outputs.artifact_suffix }}
path: '**/target/*-reports/TEST*.xml'
if-no-files-found: error
retention-days: 2
build-and-test-native:
runs-on: ubuntu-latest
needs:
- populate-cache
- generate-matrix
continue-on-error: true
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Get Maven Cache
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Set up GraalVM 21
uses: graalvm/setup-graalvm@v1
with:
distribution: 'mandrel'
version: 'latest'
java-version: 21
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Test
id: build-and-test-native
run: |
artifact_path=${{ matrix.integration-test-module }}
./mvnw \
--batch-mode \
--also-make \
--define maven.buildNumber.skip \
--define native \
--define native.surefire.skip \
--projects \
"core/deployment, \
jms/deployment, \
ra/deployment, \
${artifact_path}" \
verify
echo "artifact_suffix=${artifact_path//\//_}" >> "${GITHUB_OUTPUT}"
- name: Upload Native Test Report
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-report-native-${{ steps.build-and-test-native.outputs.artifact_suffix }}
path: '**/target/*-reports/TEST*.xml'
if-no-files-found: error
retention-days: 2