Skip to content

Commit c1d64e7

Browse files
committed
Create Test Matrix for Spring Boot
1 parent 3998a95 commit c1d64e7

File tree

3 files changed

+438
-0
lines changed

3 files changed

+438
-0
lines changed
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Spring Boot 2.x Matrix
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
spring-boot-2-matrix:
15+
timeout-minutes: 45
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
springboot-version: [ '2.1.0', '2.2.5', '2.4.13', '2.5.15', '2.6.15', '2.7.0', '2.7.18' ]
21+
22+
name: Spring Boot ${{ matrix.springboot-version }}
23+
env:
24+
SENTRY_URL: http://127.0.0.1:8000
25+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
26+
27+
steps:
28+
- name: Checkout Repo
29+
uses: actions/checkout@v5
30+
with:
31+
submodules: 'recursive'
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v6
35+
with:
36+
python-version: '3.10.5'
37+
38+
- name: Install Python dependencies
39+
run: |
40+
python3 -m pip install --upgrade pip
41+
python3 -m pip install -r requirements.txt
42+
43+
- name: Set up Java
44+
uses: actions/setup-java@v5
45+
with:
46+
distribution: 'temurin'
47+
java-version: '17'
48+
49+
- name: Setup Gradle
50+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a
51+
with:
52+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
53+
54+
- name: Update Spring Boot 2.x version
55+
run: |
56+
sed -i 's/^springboot2=.*/springboot2=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
57+
echo "Updated Spring Boot 2.x version to ${{ matrix.springboot-version }}"
58+
59+
- name: Exclude android modules from build
60+
run: |
61+
sed -i \
62+
-e '/.*"sentry-android-ndk",/d' \
63+
-e '/.*"sentry-android",/d' \
64+
-e '/.*"sentry-compose",/d' \
65+
-e '/.*"sentry-android-core",/d' \
66+
-e '/.*"sentry-android-fragment",/d' \
67+
-e '/.*"sentry-android-navigation",/d' \
68+
-e '/.*"sentry-android-sqlite",/d' \
69+
-e '/.*"sentry-android-timber",/d' \
70+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' \
71+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' \
72+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-critical",/d' \
73+
-e '/.*"sentry-android-integration-tests:test-app-sentry",/d' \
74+
-e '/.*"sentry-samples:sentry-samples-android",/d' \
75+
-e '/.*"sentry-android-replay",/d' \
76+
settings.gradle.kts
77+
78+
- name: Exclude android modules from ignore list
79+
run: |
80+
sed -i \
81+
-e '/.*"sentry-uitest-android",/d' \
82+
-e '/.*"sentry-uitest-android-benchmark",/d' \
83+
-e '/.*"sentry-uitest-android-critical",/d' \
84+
-e '/.*"test-app-sentry",/d' \
85+
-e '/.*"sentry-samples-android",/d' \
86+
build.gradle.kts
87+
88+
- name: Build SDK
89+
run: |
90+
./gradlew assemble --parallel
91+
92+
- name: Test sentry-samples-spring-boot
93+
run: |
94+
python3 test/system-test-runner.py test \
95+
--module "sentry-samples-spring-boot" \
96+
--agent false \
97+
--auto-init "true" \
98+
--build "true"
99+
100+
- name: Test sentry-samples-spring-boot-webflux
101+
run: |
102+
python3 test/system-test-runner.py test \
103+
--module "sentry-samples-spring-boot-webflux" \
104+
--agent false \
105+
--auto-init "true" \
106+
--build "true"
107+
108+
- name: Test sentry-samples-spring-boot-opentelemetry
109+
run: |
110+
python3 test/system-test-runner.py test \
111+
--module "sentry-samples-spring-boot-opentelemetry" \
112+
--agent true \
113+
--auto-init "true" \
114+
--build "true"
115+
116+
- name: Upload test results
117+
if: always()
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: test-results-springboot-2-${{ matrix.springboot-version }}
121+
path: |
122+
**/build/reports/*
123+
**/build/test-results/**/*.xml
124+
sentry-mock-server.txt
125+
spring-server.txt
126+
127+
- name: Test Report
128+
uses: phoenix-actions/test-reporting@f957cd93fc2d848d556fa0d03c57bc79127b6b5e # pin@v15
129+
if: always()
130+
with:
131+
name: JUnit Spring Boot 2.x ${{ matrix.springboot-version }}
132+
path: |
133+
**/build/test-results/**/*.xml
134+
reporter: java-junit
135+
output-to: step-summary
136+
fail-on-error: false
137+
138+
- name: Upload test results to Codecov
139+
if: ${{ !cancelled() }}
140+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f
141+
with:
142+
token: ${{ secrets.CODECOV_TOKEN }}
143+
file: '**/build/test-results/**/*.xml'
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Spring Boot 3.x Matrix
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
spring-boot-3-matrix:
15+
timeout-minutes: 45
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
springboot-version: [ '3.0.0', '3.2.10', '3.3.5', '3.4.5', '3.5.6' ]
21+
22+
name: Spring Boot ${{ matrix.springboot-version }}
23+
env:
24+
SENTRY_URL: http://127.0.0.1:8000
25+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
26+
27+
steps:
28+
- name: Checkout Repo
29+
uses: actions/checkout@v5
30+
with:
31+
submodules: 'recursive'
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v6
35+
with:
36+
python-version: '3.10.5'
37+
38+
- name: Install Python dependencies
39+
run: |
40+
python3 -m pip install --upgrade pip
41+
python3 -m pip install -r requirements.txt
42+
43+
- name: Set up Java
44+
uses: actions/setup-java@v5
45+
with:
46+
distribution: 'temurin'
47+
java-version: '17'
48+
49+
- name: Setup Gradle
50+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a
51+
with:
52+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
53+
54+
- name: Update Spring Boot 3.x version
55+
run: |
56+
sed -i 's/^springboot3=.*/springboot3=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
57+
echo "Updated Spring Boot 3.x version to ${{ matrix.springboot-version }}"
58+
59+
- name: Exclude android modules from build
60+
run: |
61+
sed -i \
62+
-e '/.*"sentry-android-ndk",/d' \
63+
-e '/.*"sentry-android",/d' \
64+
-e '/.*"sentry-compose",/d' \
65+
-e '/.*"sentry-android-core",/d' \
66+
-e '/.*"sentry-android-fragment",/d' \
67+
-e '/.*"sentry-android-navigation",/d' \
68+
-e '/.*"sentry-android-sqlite",/d' \
69+
-e '/.*"sentry-android-timber",/d' \
70+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' \
71+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' \
72+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-critical",/d' \
73+
-e '/.*"sentry-android-integration-tests:test-app-sentry",/d' \
74+
-e '/.*"sentry-samples:sentry-samples-android",/d' \
75+
-e '/.*"sentry-android-replay",/d' \
76+
settings.gradle.kts
77+
78+
- name: Exclude android modules from ignore list
79+
run: |
80+
sed -i \
81+
-e '/.*"sentry-uitest-android",/d' \
82+
-e '/.*"sentry-uitest-android-benchmark",/d' \
83+
-e '/.*"sentry-uitest-android-critical",/d' \
84+
-e '/.*"test-app-sentry",/d' \
85+
-e '/.*"sentry-samples-android",/d' \
86+
build.gradle.kts
87+
88+
- name: Build SDK
89+
run: |
90+
./gradlew assemble --parallel
91+
92+
- name: Test sentry-samples-spring-boot-jakarta
93+
run: |
94+
python3 test/system-test-runner.py test \
95+
--module "sentry-samples-spring-boot-jakarta" \
96+
--agent false \
97+
--auto-init "true" \
98+
--build "true"
99+
100+
- name: Test sentry-samples-spring-boot-webflux-jakarta
101+
run: |
102+
python3 test/system-test-runner.py test \
103+
--module "sentry-samples-spring-boot-webflux-jakarta" \
104+
--agent false \
105+
--auto-init "true" \
106+
--build "true"
107+
108+
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry
109+
run: |
110+
python3 test/system-test-runner.py test \
111+
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
112+
--agent true \
113+
--auto-init "true" \
114+
--build "true"
115+
116+
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry-noagent
117+
run: |
118+
python3 test/system-test-runner.py test \
119+
--module "sentry-samples-spring-boot-jakarta-opentelemetry-noagent" \
120+
--agent false \
121+
--auto-init "true" \
122+
--build "true"
123+
124+
- name: Upload test results
125+
if: always()
126+
uses: actions/upload-artifact@v4
127+
with:
128+
name: test-results-springboot-3-${{ matrix.springboot-version }}
129+
path: |
130+
**/build/reports/*
131+
**/build/test-results/**/*.xml
132+
sentry-mock-server.txt
133+
spring-server.txt
134+
135+
- name: Test Report
136+
uses: phoenix-actions/test-reporting@f957cd93fc2d848d556fa0d03c57bc79127b6b5e # pin@v15
137+
if: always()
138+
with:
139+
name: JUnit Spring Boot 3.x ${{ matrix.springboot-version }}
140+
path: |
141+
**/build/test-results/**/*.xml
142+
reporter: java-junit
143+
output-to: step-summary
144+
fail-on-error: false
145+
146+
- name: Upload test results to Codecov
147+
if: ${{ !cancelled() }}
148+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f
149+
with:
150+
token: ${{ secrets.CODECOV_TOKEN }}
151+
file: '**/build/test-results/**/*.xml'

0 commit comments

Comments
 (0)