-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
74 lines (69 loc) · 1.34 KB
/
.gitlab-ci.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
stages:
- verify
- build
- test
cache:
- key: npm-cache
paths:
- client/node_modules
- key: gradle-cache
paths:
- server/.gradle/caches
- server/.gradle/notifications
- server/.gradle/wrapper
# verify stage
eslint:
stage: verify
image: node:18
script:
- cd client
- npm install
- npm run eslint
# build stage
build-npm:
stage: build
image: node:18.12.1-alpine
script:
- cd client
- npm install webpack-cli -g
- npm install
- npm rebuild node-sass
- npm run build
artifacts:
expire_in: 1 week
paths:
- client/build/
build-server:
stage: build
image: eclipse-temurin:17-jdk-jammy
script:
- cd server
- chmod +x ./gradlew
- ./gradlew --gradle-user-home .gradle/ build -x test
artifacts:
expire_in: 1 week
paths:
- server/build/libs/
# test stage
test-server:
stage: test
needs:
- build-server
image: eclipse-temurin:17-jdk-jammy
variables:
MYSQL_DATABASE: test_database
MYSQL_HOST: localhost
MYSQL_PORT: 3000
MYSQL_USER: test_user
MYSQL_PASSWORD: test_password
script:
- cd server
- chmod +x ./gradlew
- ./gradlew --gradle-user-home .gradle/ test
dependencies:
- build-server
artifacts:
when: always
reports:
junit:
- server/build/test-results/test/**/TEST-*.xml