-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
129 lines (117 loc) · 2.54 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
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
image: xwiillz/node-chromium-mongo:lts-bionic
cache:
key: '${CI_COMMIT_REF_SLUG}-client'
paths:
- client/node_modules/
- server/node_modules/
policy: pull
.only-client: &only-client
only:
refs:
- master
- merge_requests
changes:
- client/**/*
cache:
key: '${CI_COMMIT_REF_SLUG}-client'
paths:
- client/node_modules/
policy: pull
.only-server: &only-server
only:
refs:
- master
- merge_requests
changes:
- server/**/*
cache:
key: '${CI_COMMIT_REF_SLUG}-server'
paths:
- server/node_modules/
policy: pull
stages:
- install
- lint
- build
- test
install:client:
stage: install
<<: *only-client
script:
- cd client
- npm ci --cache .npm --prefer-offline
cache:
key: '${CI_COMMIT_REF_SLUG}-client'
paths:
- client/node_modules/
- client/.npm/
policy: pull-push
install:server:
stage: install
<<: *only-server
script:
- cd server
- npm ci --cache .npm --prefer-offline
cache:
key: '${CI_COMMIT_REF_SLUG}-server'
paths:
- server/node_modules/
- server/.npm/
policy: pull-push
lint:client:
stage: lint
<<: *only-client
script:
- cd client
- npm run lint
lint:server:
stage: lint
<<: *only-server
script:
- cd server
- npm run lint
build:client:
stage: build
<<: *only-client
script:
- cd client
- npm run build
artifacts:
paths:
- client/dist/
build:server:
stage: build
<<: *only-server
script:
- cd server
- npm run build
artifacts:
paths:
- server/out/
test:client:
stage: test
<<: *only-client
script:
- Xvfb :99 -ac -screen 0 1920x1080x24 &
- cd client
- npm run coverage -- --browsers=ChromeHeadlessNoSandbox --watch=false
dependencies:
- build:client
artifacts:
paths:
- client/coverage/
reports:
cobertura: client/coverage/cobertura-coverage.xml
test:server:
stage: test
<<: *only-server
script:
- cd server
- npm run coverage
dependencies:
- build:server
artifacts:
paths:
- server/coverage/
reports:
cobertura: server/coverage/cobertura-coverage.xml