-
-
Notifications
You must be signed in to change notification settings - Fork 475
363 lines (319 loc) · 14.4 KB
/
Copy pathspring-boot-2-matrix.yml
File metadata and controls
363 lines (319 loc) · 14.4 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
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
name: Spring Boot 2.x Matrix
on:
push:
branches:
- main
paths-ignore:
- '*android*/**'
- 'sentry-compose/**'
- 'sentry-samples/sentry-samples-android/**'
pull_request:
paths-ignore:
- '*android*/**'
- 'sentry-compose/**'
- 'sentry-samples/sentry-samples-android/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
spring-boot-2-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
steps:
- id: set
run: echo 'matrix=["2.1.0","2.2.5","2.4.13","2.5.15","2.6.15","2.7.0","2.7.18"]' >> $GITHUB_OUTPUT
# One Gradle build per matrix cell → artifact sdk-build-sb2-{version} (sentry-*/build/libs,
# retention-days: 1, same workflow only). continue-on-error: without it, one failed version
# skips the entire spring-boot-2-matrix job (needs is job-level). Triage: spring-boot-2-matrix.
spring-boot-2-build:
needs: [spring-boot-2-versions]
continue-on-error: true
timeout-minutes: 25
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
springboot-version: ${{ fromJSON(needs.spring-boot-2-versions.outputs.matrix) }}
name: Build Spring Boot ${{ matrix.springboot-version }}
env:
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
submodules: 'recursive'
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: 'temurin'
java-version: '17'
# Workaround for https://github.com/gradle/actions/issues/21 to use config cache
- name: Cache buildSrc
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: buildSrc/build
key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Update Spring Boot 2.x version
run: |
sed -i 's/^springboot2=.*/springboot2=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
echo "Updated Spring Boot 2.x version to ${{ matrix.springboot-version }}"
- name: Exclude android modules from build
run: |
sed -i \
-e '/.*"sentry-android-ndk",/d' \
-e '/.*"sentry-android",/d' \
-e '/.*"sentry-compose",/d' \
-e '/.*"sentry-android-core",/d' \
-e '/.*"sentry-android-fragment",/d' \
-e '/.*"sentry-android-navigation",/d' \
-e '/.*"sentry-android-sqlite",/d' \
-e '/.*"sentry-android-timber",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-critical",/d' \
-e '/.*"sentry-android-integration-tests:test-app-sentry",/d' \
-e '/.*"sentry-android-integration-tests:test-app-size",/d' \
-e '/.*"sentry-samples:sentry-samples-android",/d' \
-e '/.*"sentry-android-replay",/d' \
settings.gradle.kts
- name: Exclude android modules from ignore list
run: |
sed -i \
-e '/.*"sentry-uitest-android",/d' \
-e '/.*"sentry-uitest-android-benchmark",/d' \
-e '/.*"sentry-uitest-android-critical",/d' \
-e '/.*"test-app-sentry",/d' \
-e '/.*"test-app-size",/d' \
-e '/.*"sentry-samples-android",/d' \
build.gradle.kts
- name: Build SDK and samples
run: |
./gradlew assemble \
:sentry-samples:sentry-samples-spring-boot:shadowJar \
:sentry-samples:sentry-samples-spring-boot-webflux:shadowJar \
:sentry-samples:sentry-samples-spring-boot-opentelemetry:shadowJar \
:sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent:shadowJar \
--parallel
- name: Upload build artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sdk-build-sb2-${{ matrix.springboot-version }}
path: |
sentry-*/**/build/libs/*.jar
retention-days: 1
# System tests per (springboot-version × sample config). Uses sdk-build-sb2-{version} at
# workspace root (download path: .) and test/system-test-runner.py with --build false.
# Failure triage: (1) spring-boot-2-build cell for that version, (2) Download build artifact,
# (3) Run system test / spring-server.txt / test-results. Build job may be green while
# version cells are red (continue-on-error); failed builds fail here, not as skipped jobs.
spring-boot-2-matrix:
timeout-minutes: 20
runs-on: ubuntu-latest
needs: [spring-boot-2-build, spring-boot-2-versions]
strategy:
fail-fast: false
matrix:
springboot-version: ${{ fromJSON(needs.spring-boot-2-versions.outputs.matrix) }}
config:
- { sample: "sentry-samples-spring-boot", agent: "false", auto_init: "true" }
- { sample: "sentry-samples-spring-boot-webflux", agent: "false", auto_init: "true" }
- { sample: "sentry-samples-spring-boot-opentelemetry", agent: "true", auto_init: "true" }
- { sample: "sentry-samples-spring-boot-opentelemetry", agent: "true", auto_init: "false" }
- { sample: "sentry-samples-spring-boot-opentelemetry-noagent", agent: "false", auto_init: "true" }
name: Spring Boot ${{ matrix.springboot-version }} - ${{ matrix.config.sample }} (agent=${{ matrix.config.agent }}, auto-init=${{ matrix.config.auto_init }})
env:
SENTRY_URL: http://127.0.0.1:8000
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.10.5'
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Update Spring Boot 2.x version
run: |
sed -i 's/^springboot2=.*/springboot2=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
- name: Download build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: sdk-build-sb2-${{ matrix.springboot-version }}
path: .
# Guard against a confusing silent failure: if the agent JAR is absent,
# ensure_agent_jar() in the test runner falls back to building it via Gradle
# without the Spring Boot version pin or android exclusions applied — a slow,
# misconfigured build that will likely time out. Fail fast and clearly instead.
- name: Verify agent JAR present in artifact
if: matrix.config.agent == 'true'
run: |
jar=$(find sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/ \
-name "*agent*.jar" \
! -name "*dontuse*" ! -name "*sources*" ! -name "*javadoc*" \
-print -quit 2>/dev/null)
if [ -z "$jar" ]; then
echo "ERROR: agent JAR not found in downloaded artifact."
echo "Expected: sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/*agent*.jar"
echo "Check that the build job's artifact upload completed successfully."
exit 1
fi
echo "Agent JAR found: $jar"
- name: Run system test
run: |
python3 test/system-test-runner.py test \
--module "${{ matrix.config.sample }}" \
--agent "${{ matrix.config.agent }}" \
--auto-init "${{ matrix.config.auto_init }}" \
--build "false"
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: test-results-springboot-2-${{ matrix.springboot-version }}-${{ matrix.config.sample }}-agent${{ matrix.config.agent }}-init${{ matrix.config.auto_init }}
path: |
**/build/reports/*
**/build/test-results/**/*.xml
sentry-mock-server.txt
spring-server.txt
- name: Test Report
uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16
if: always()
with:
name: JUnit Spring Boot 2.x ${{ matrix.springboot-version }} ${{ matrix.config.sample }}
path: |
**/build/test-results/**/*.xml
reporter: java-junit
output-to: step-summary
fail-on-error: false
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: '**/build/test-results/**/*.xml'
spring-boot-2-war:
needs: [spring-boot-2-versions]
timeout-minutes: 25
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
springboot-version: ${{ fromJSON(needs.spring-boot-2-versions.outputs.matrix) }}
name: Spring Boot ${{ matrix.springboot-version }} - sentry-samples-spring (agent=false, auto-init=true)
env:
SENTRY_URL: http://127.0.0.1:8000
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.10.5'
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: 'temurin'
java-version: '17'
# Workaround for https://github.com/gradle/actions/issues/21 to use config cache
- name: Cache buildSrc
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: buildSrc/build
key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Update Spring Boot 2.x version
run: |
sed -i 's/^springboot2=.*/springboot2=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
echo "Updated Spring Boot 2.x version to ${{ matrix.springboot-version }}"
- name: Exclude android modules from build
run: |
sed -i \
-e '/.*"sentry-android-ndk",/d' \
-e '/.*"sentry-android",/d' \
-e '/.*"sentry-compose",/d' \
-e '/.*"sentry-android-core",/d' \
-e '/.*"sentry-android-fragment",/d' \
-e '/.*"sentry-android-navigation",/d' \
-e '/.*"sentry-android-sqlite",/d' \
-e '/.*"sentry-android-timber",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-critical",/d' \
-e '/.*"sentry-android-integration-tests:test-app-sentry",/d' \
-e '/.*"sentry-android-integration-tests:test-app-size",/d' \
-e '/.*"sentry-samples:sentry-samples-android",/d' \
-e '/.*"sentry-android-replay",/d' \
settings.gradle.kts
- name: Exclude android modules from ignore list
run: |
sed -i \
-e '/.*"sentry-uitest-android",/d' \
-e '/.*"sentry-uitest-android-benchmark",/d' \
-e '/.*"sentry-uitest-android-critical",/d' \
-e '/.*"test-app-sentry",/d' \
-e '/.*"test-app-size",/d' \
-e '/.*"sentry-samples-android",/d' \
build.gradle.kts
- name: Build SDK
run: |
./gradlew assemble --parallel
- name: Run system test
run: |
python3 test/system-test-runner.py test \
--module "sentry-samples-spring" \
--agent "false" \
--auto-init "true" \
--build "true"
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: test-results-springboot-2-${{ matrix.springboot-version }}-sentry-samples-spring-agentfalse-inittrue
path: |
**/build/reports/*
**/build/test-results/**/*.xml
sentry-mock-server.txt
spring-server.txt
- name: Test Report
uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16
if: always()
with:
name: JUnit Spring Boot 2.x ${{ matrix.springboot-version }} sentry-samples-spring
path: |
**/build/test-results/**/*.xml
reporter: java-junit
output-to: step-summary
fail-on-error: false
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: '**/build/test-results/**/*.xml'