forked from apereo/cas
-
Notifications
You must be signed in to change notification settings - Fork 0
325 lines (302 loc) · 11.6 KB
/
validation.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
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
name: Validation
env:
JAVA_OPTS: "-Xms512m -Xmx6048m -Xss128m -XX:ReservedCodeCacheSize=512m -server"
GRADLE_OPTS: "-Xms512m -Xmx6048m -Xss128m -XX:ReservedCodeCacheSize=512m -server"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PACKAGE_REGISTRY_USER: ${{ secrets.GH_PACKAGE_REGISTRY_USER }}
GH_PACKAGE_REGISTRY_TOKEN: ${{ secrets.GH_PACKAGE_REGISTRY_TOKEN }}
GRADLE_BUILDCACHE_USER: ci
GRADLE_BUILDCACHE_PSW: ${{ secrets.GRADLE_BUILDCACHE_PSW }}
TERM: xterm-256color
JDK_CURRENT: 17
##########################################################################
on:
push:
branches: [ master ]
pull_request:
types: [ labeled ]
branches: [ master ]
##########################################################################
jobs:
cancel-previous-runs:
if: ${{ (github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI')) && !contains(github.event.head_commit.message, 'trigger dependency update') && !contains(github.event.head_commit.message, 'documentation update') && !contains(github.event.head_commit.message, 'ci:minimal') }}
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
##########################################################################
initialize:
runs-on: ubuntu-latest
needs: [cancel-previous-runs]
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: ls ./ci && chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
##########################################################################
cache:
runs-on: ubuntu-latest
needs: [initialize]
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/checkout@v3
- name: Download Dependencies
run: ./gradlew --build-cache --configure-on-demand --no-daemon downloadDependencies --parallel --refresh-dependencies --max-workers=8
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
##########################################################################
validate-javadocs:
runs-on: ubuntu-latest
needs: [cache]
continue-on-error: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Javadocs
run: ./gradlew --build-cache --configure-on-demand --no-daemon --parallel javadoc -x test -x check -DskipNestedConfigMetadataGen=true --parallel --max-workers=8
##########################################################################
validate-commandline-shell:
runs-on: ubuntu-latest
needs: [cache]
continue-on-error: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate CAS Command-line Shell
run: |
chmod -R +x ./ci/tests/shell/run-shell.sh && ./ci/tests/shell/run-shell.sh
echo "Checking for stack traces in output that would indicate an error"
cat cas-shell.out
count=$(grep -c -e ".*\(Exception\|Throwable\|caused\\sby\).*" cas-shell.out || true);
test $count -eq 0
##########################################################################
validate-webapp-embedded:
runs-on: ubuntu-latest
needs: [cache]
continue-on-error: false
strategy:
fail-fast: false
matrix:
category:
- tomcat
- jetty
- undertow
name: embedded - ${{ matrix.category }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Web Application Server
run: ./ci/tests/webapp/validate-embedded-webapp.sh ${{ matrix.category }}
##########################################################################
validate-webapp-external:
runs-on: ubuntu-latest
needs: [cache]
continue-on-error: false
strategy:
fail-fast: false
matrix:
category:
- cas-server
- config-server
- discovery-server
- bootadmin-server
name: external tomcat - ${{ matrix.category }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Web Application Server via External Apache Tomcat
run: ./ci/tests/webapp/validate-external-webapp.sh ${{ matrix.category }}
##########################################################################
validate-spring-cloud-config-server:
runs-on: ubuntu-latest
needs: [cache]
continue-on-error: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Spring Cloud Configuration Server
run: ./ci/tests/webapp/validate-configserver-webapp.sh
##########################################################################
validate-eureka-discovery-server:
runs-on: ubuntu-latest
needs: [cache]
continue-on-error: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Eureka Discovery Server
run: ./ci/tests/webapp/validate-eurekaserver-webapp.sh
##########################################################################
validate-spring-boot-admin-server:
runs-on: ubuntu-latest
needs: [cache]
continue-on-error: false
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-{{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1
- name: Initialize
run: chmod -R +x ./ci/**/*.sh && ./ci/init-build.sh
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Spring Boot Admin Server
run: ./ci/tests/webapp/validate-bootadmin-webapp.sh