-
-
Notifications
You must be signed in to change notification settings - Fork 20
539 lines (539 loc) · 24 KB
/
applications.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
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
name: JHipster Svelte Generated Applications
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
TEST_SCRIPTS_PATH: ${{ github.workspace }}/.github/workflows/scripts
jobs:
svelte-image:
name: Prepare JHipster Svelte Image
runs-on: ubuntu-latest
concurrency:
group: apps-dev-${{ matrix.apps }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- name: Create JHipster Svelte docker image
run: |
docker build -t jhipster/jhipster-svelte:$GITHUB_SHA --build-arg UID=$(id -u) --build-arg GID=$(id -g) .
mkdir -p svelte-artifacts/images
docker save jhipster/jhipster-svelte:$GITHUB_SHA > svelte-artifacts/images/svelte-image.tar
- name: Save Svelte Docker image
uses: actions/upload-artifact@v2
with:
name: docker-artifact
path: svelte-artifacts/images
retention-days: 1
development-profile-builds:
needs: svelte-image
name: ${{ matrix.apps }}
concurrency:
group: apps-dev-${{ matrix.apps }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
apps:
[
'monolithic-session-maven.jdl',
'monolithic-session-gradle.json',
'monolithic-jwt-maven-skip-user.jdl',
'monolithic-jwt-gradle.json',
'monolithic-session-maven-reactive.jdl',
]
os: [ubuntu-latest]
node_version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Download latest chrome binary
if: contains(matrix.os , 'ubuntu-latest')
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable -y
sudo apt-get install xvfb
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Gradle - Configure cache
uses: actions/cache@v2
if: contains(matrix.apps, 'gradle')
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-7.9.3
- name: Maven - Configure cache
uses: actions/cache@v2
if: contains(matrix.apps, 'maven')
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-7.9.3
- name: Configure cypress cache
uses: actions/cache@v2
with:
path: |
~/.cache/Cypress/13.5.x
~/.cache/Cypress/cy
key: ${{ runner.os }}-cypress-13.5.x
- name: Retrieve saved Svelte Docker Image
uses: actions/download-artifact@v2
with:
name: docker-artifact
path: svelte-artifacts/images
- name: Docker load
run: |
cd svelte-artifacts/images
docker load < svelte-image.tar
- name: Prepare environment
run: |
mkdir -p "$HOME/svelte-app"
mkdir -p "$HOME/.m2"
mkdir -p "$HOME/.gradle"
mkdir -p "$HOME/.cache"
- name: Generate application
if: contains(matrix.apps, '.json')
run: |
cd "$HOME/svelte-app"
cp $TEST_SCRIPTS_PATH/${{ matrix.apps }} .yo-rc.json
docker run --rm -v $PWD:/app -v $HOME/.cache:/home/jsvelte/.cache jhipster/jhipster-svelte:$GITHUB_SHA --no-insight --force
- name: Generate application
if: contains(matrix.apps, '.jdl')
run: |
cd "$HOME/svelte-app"
cp $TEST_SCRIPTS_PATH/${{ matrix.apps }} app.jdl
docker run --rm -v $PWD:/app -v $HOME/.cache:/home/jsvelte/.cache jhipster/jhipster-svelte:$GITHUB_SHA import-jdl app.jdl --no-insight --force
- name: Maven - Unit tests
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-app"
docker run --rm -v $PWD:/app -v $HOME/.m2:/home/jsvelte/.m2 --entrypoint ./mvnw jhipster/jhipster-svelte:$GITHUB_SHA -ntp test
- name: Gradle - Unit tests
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-app"
docker run --rm -v $PWD:/app -v $HOME/.gradle:/home/jsvelte/.gradle --entrypoint ./gradlew jhipster/jhipster-svelte:$GITHUB_SHA test --no-daemon
- name: Frontend - Lint application
run: |
cd "$HOME/svelte-app"
docker run --rm -v $PWD:/app --entrypoint ./npmw jhipster/jhipster-svelte:$GITHUB_SHA run lint
- name: Frontend - Unit tests
run: |
cd "$HOME/svelte-app"
docker run --rm -v $PWD:/app --entrypoint ./npmw jhipster/jhipster-svelte:$GITHUB_SHA test -- --coverage
- name: Maven - Package application
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-app"
docker run --rm -v $PWD:/app -v $HOME/.m2:/home/jsvelte/.m2 --entrypoint ./mvnw jhipster/jhipster-svelte:$GITHUB_SHA -ntp verify
- name: Gradle - Package application
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-app"
docker run --rm -v $PWD:/app -v $HOME/.gradle:/home/jsvelte/.gradle --entrypoint ./gradlew jhipster/jhipster-svelte:$GITHUB_SHA bootJar --no-daemon
- name: Maven - Cypress tests
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-app"
docker run -d --rm -v $PWD:/app -v $HOME/.m2:/home/jsvelte/.m2 -p8080:8080 --entrypoint ./mvnw jhipster/jhipster-svelte:$GITHUB_SHA -DskipTests
timeout 180 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080/api/authenticate)" != "200" ]]; do sleep 5; done' || false
npm run e2e:ci
- name: Gradle Cypress tests
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-app"
docker run --rm -v $PWD:/app -v $HOME/.gradle:/home/jsvelte/.gradle --entrypoint ./gradlew jhipster/jhipster-svelte:$GITHUB_SHA clean
docker run -d --rm -v $PWD:/app -v $HOME/.gradle:/home/jsvelte/.gradle -p8080:8080 --entrypoint ./gradlew jhipster/jhipster-svelte:$GITHUB_SHA -x test
timeout 180 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080/api/authenticate)" != "200" ]]; do sleep 5; done' || false
npm run e2e:ci
production-profile-builds:
needs: svelte-image
name: ${{ matrix.apps }}
concurrency:
group: apps-prod-${{ matrix.apps }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
if: github.event.action != 'closed'
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
apps:
[
'monolithic-jwt-maven-mongodb-prod.jdl',
'monolithic-session-maven-postgres-prod.jdl',
'monolithic-oidc-maven-postgres-prod.jdl',
'gateway-jwt-maven-postgres-prod.jdl',
]
os: [ubuntu-latest]
node_version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Download latest chrome binary
if: contains(matrix.os , 'ubuntu-latest')
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable -y
sudo apt-get install xvfb
- uses: actions/setup-java@v1
with:
java-version: '11'
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Gradle - Configure cache
uses: actions/cache@v2
if: contains(matrix.apps, 'gradle')
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-7.9.3
- name: Maven - Configure cache
uses: actions/cache@v2
if: contains(matrix.apps, 'maven')
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-7.9.3
- name: Configure cypress cache
uses: actions/cache@v2
with:
path: |
~/.cache/Cypress/13.5.x
~/.cache/Cypress/cy
key: ${{ runner.os }}-cypress-13.5.x
- name: Retrieve saved Svelte Docker Image
uses: actions/download-artifact@v2
with:
name: docker-artifact
path: svelte-artifacts/images
- name: Docker load
run: |
cd svelte-artifacts/images
docker load < svelte-image.tar
- name: Prepare environment
run: |
mkdir -p "$HOME/svelte-app"
mkdir -p "$HOME/.m2"
mkdir -p "$HOME/.gradle"
mkdir -p "$HOME/.cache"
- name: Generate application
if: contains(matrix.apps, '.json')
run: |
cd "$HOME/svelte-app"
cp $TEST_SCRIPTS_PATH/${{ matrix.apps }} .yo-rc.json
docker run --rm -v $PWD:/app -v $HOME/.cache:/home/jsvelte/.cache jhipster/jhipster-svelte:$GITHUB_SHA --no-insight --force
- name: Generate application
if: contains(matrix.apps, '.jdl')
run: |
cd "$HOME/svelte-app"
cp $TEST_SCRIPTS_PATH/${{ matrix.apps }} app.jdl
docker run --rm -v $PWD:/app -v $HOME/.cache:/home/jsvelte/.cache jhipster/jhipster-svelte:$GITHUB_SHA import-jdl app.jdl --no-insight --force
- name: Maven - Unit tests
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-app"
rm -rf node_modules/generator-jhipster-svelte
./mvnw -ntp test
- name: Gradle - Unit tests
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-app"
rm -rf node_modules/generator-jhipster-svelte
./gradlew test --no-daemon
- name: Frontend - Lint application
run: |
cd "$HOME/svelte-app"
./npmw run lint
- name: Frontend - Unit tests
run: |
cd "$HOME/svelte-app"
./npmw run test -- --coverage
- name: Maven - Package application
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-app"
./mvnw -ntp -Pprod verify
- name: Gradle - Package application
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-app"
./gradlew -Pprod bootJar --no-daemon
- name: Maven - Build application docker image
if: contains(matrix.apps, 'maven')
run: |
cd "$HOME/svelte-app"
./mvnw -ntp -Pprod compile jib:dockerBuild
- name: Gradle - Build application docker image
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-app"
./gradlew -Pprod jibDockerBuild
- name: Start Keycloak container
if: contains(matrix.apps, 'oidc')
run: |
cd "$HOME/svelte-app"
sudo echo "127.0.0.1 keycloak" | sudo tee -a /etc/hosts
docker-compose -f src/main/docker/keycloak.yml up -d
timeout 180 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9080)" != "200" ]]; do sleep 5; done' || false
- name: Run Cypress tests
run: |
cd "$HOME/svelte-app"
sudo echo "127.0.0.1 keycloak" | sudo tee -a /etc/hosts
docker-compose -f src/main/docker/app.yml up -d
timeout 180 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080/api/authenticate)" != "200" ]]; do sleep 5; done' || false
npm run e2e:ci
microservices-production-profile-builds:
needs: svelte-image
name: ${{ matrix.apps }}
concurrency:
group: ms-apps-prod-${{ matrix.apps }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
if: github.event.action != 'closed'
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
apps: ['microservices-oidc-maven-prod.jdl']
os: [ubuntu-latest]
node_version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Download latest chrome binary
if: contains(matrix.os , 'ubuntu-latest')
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable -y
sudo apt-get install xvfb
- uses: actions/setup-java@v1
with:
java-version: '11'
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Gradle - Configure cache
uses: actions/cache@v2
if: contains(matrix.apps, 'gradle')
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-7.9.3
- name: Maven - Configure cache
uses: actions/cache@v2
if: contains(matrix.apps, 'maven')
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-7.9.3
- name: Configure cypress cache
uses: actions/cache@v2
with:
path: |
~/.cache/Cypress/13.5.x
~/.cache/Cypress/cy
key: ${{ runner.os }}-cypress-13.5.x
- name: Retrieve saved Svelte Docker Image
uses: actions/download-artifact@v2
with:
name: docker-artifact
path: svelte-artifacts/images
- name: Docker load
run: |
cd svelte-artifacts/images
docker load < svelte-image.tar
- name: Prepare environment
run: |
mkdir -p "$HOME/svelte-ms"
mkdir -p "$HOME/.m2"
mkdir -p "$HOME/.gradle"
mkdir -p "$HOME/.cache"
- name: Generate application
if: contains(matrix.apps, '.jdl')
run: |
cd "$HOME/svelte-ms"
cp $TEST_SCRIPTS_PATH/${{ matrix.apps }} app.jdl
docker run --rm -v $PWD:/app -v $HOME/.cache:/home/jsvelte/.cache jhipster/jhipster-svelte:$GITHUB_SHA import-jdl app.jdl --no-insight --force
- name: Maven - Unit tests - Gateway
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-ms/gateway"
rm -rf node_modules/generator-jhipster-svelte
./mvnw -ntp test
- name: Maven - Unit tests - Microservice
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-ms/blog"
rm -rf node_modules/generator-jhipster-svelte
./mvnw -ntp test
- name: Gradle - Unit tests - Gateway
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-ms/gateway"
rm -rf node_modules/generator-jhipster-svelte
./gradlew test --no-daemon
- name: Gradle - Unit tests - Microservice
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-ms/blog"
rm -rf node_modules/generator-jhipster-svelte
./gradlew test --no-daemon
- name: Frontend - Lint application
run: |
cd "$HOME/svelte-ms/gateway"
./npmw run lint
- name: Frontend - Unit tests
run: |
cd "$HOME/svelte-ms/gateway"
./npmw run test -- --coverage
- name: Maven - Package application - Gateway
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-ms/gateway"
./mvnw -ntp -Pprod verify
- name: Maven - Package application - Microservice
if: contains(matrix.apps , 'maven')
run: |
cd "$HOME/svelte-ms/blog"
./mvnw -ntp -Pprod verify
- name: Gradle - Package application - Gateway
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-ms/gateway"
./gradlew -Pprod bootJar --no-daemon
- name: Gradle - Package application - Microservice
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-ms/blog"
./gradlew -Pprod bootJar --no-daemon
- name: Maven - Build application docker image - Gateway
if: contains(matrix.apps, 'maven')
run: |
cd "$HOME/svelte-ms/gateway"
./mvnw -ntp -Pprod compile jib:dockerBuild
- name: Maven - Build application docker image - Microservice
if: contains(matrix.apps, 'maven')
run: |
cd "$HOME/svelte-ms/blog"
./mvnw -ntp -Pprod compile jib:dockerBuild
- name: Gradle - Build application docker image - Gateway
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-ms/gateway"
./gradlew -Pprod jibDockerBuild
- name: Gradle - Build application docker image - Microservice
if: contains(matrix.apps, 'gradle')
run: |
cd "$HOME/svelte-ms/blog"
./gradlew -Pprod jibDockerBuild
- name: Start Keycloak container
if: contains(matrix.apps, 'oidc')
run: |
sudo echo "127.0.0.1 keycloak" | sudo tee -a /etc/hosts
cd "$HOME/svelte-ms/docker-compose"
docker-compose up -d keycloak
timeout 180 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9080)" != "200" ]]; do sleep 5; done' || false
- name: Run Cypress tests
run: |
sudo echo "127.0.0.1 keycloak" | sudo tee -a /etc/hosts
cd "$HOME/svelte-ms/docker-compose"
docker-compose up -d
timeout 180 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080/api/authenticate)" != "200" ]]; do sleep 5; done' || false
cd "$HOME/svelte-ms/gateway"
npm run e2e:ci
lighthouse-job:
needs: svelte-image
name: ${{ matrix.apps }}
concurrency:
group: lighthouse-${{ matrix.apps }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
apps: ['svelte-app-session-lighthouse.jdl']
os: [ubuntu-latest]
node_version: [16.x]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Download latest chrome binary
if: contains(matrix.os , 'ubuntu-latest')
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable -y
sudo apt-get install xvfb
- uses: actions/setup-java@v1
with:
java-version: '11'
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Maven - Configure cache
uses: actions/cache@v2
if: contains(matrix.apps, 'maven')
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-7.9.3
- name: Configure cypress cache
uses: actions/cache@v2
with:
path: |
~/.cache/Cypress/13.5.x
~/.cache/Cypress/cy
key: ${{ runner.os }}-cypress-13.5.x
- name: Retrieve saved Svelte Docker Image
uses: actions/download-artifact@v2
with:
name: docker-artifact
path: svelte-artifacts/images
- name: Docker load
run: |
cd svelte-artifacts/images
docker load < svelte-image.tar
- name: Prepare environment
run: |
mkdir -p "$HOME/svelte-app"
mkdir -p "$HOME/.m2"
mkdir -p "$HOME/.gradle"
mkdir -p "$HOME/.cache"
- name: Generate application
run: |
cd "$HOME/svelte-app"
cp $TEST_SCRIPTS_PATH/${{ matrix.apps }} app.jdl
docker run --rm -v $PWD:/app -v $HOME/.cache:/home/jsvelte/.cache jhipster/jhipster-svelte:$GITHUB_SHA import-jdl app.jdl --no-insight --force
rm -rf node_modules/generator-jhipster-svelte
- name: Build application docker image
run: |
cd "$HOME/svelte-app"
./mvnw -ntp -Pprod compile jib:dockerBuild
- name: Prepare Lighthouse run prerequisites
run: |
cd "$HOME/svelte-app"
npm install -g @lhci/cli
npm install --save puppeteer
docker-compose -f src/main/docker/app.yml up -d
timeout 180 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080/api/authenticate)" != "200" ]]; do sleep 5; done' || false
- name: Run Lighthouse tests - Unauthenticated Pages
run: |
cd "$HOME/svelte-app"
cp $TEST_SCRIPTS_PATH/lighthouse/lighthouserc.json lighthouserc.json
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
- name: Run Lighthouse tests - Authenticated Pages
run: |
cd "$HOME/svelte-app"
cp $TEST_SCRIPTS_PATH/lighthouse/lighthouserc-auth.json lighthouserc.json
cp $TEST_SCRIPTS_PATH/lighthouse/puppeteer-auth.cjs puppeteer-auth.cjs
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}