forked from Snail-IDE/snail-ide.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
329 lines (324 loc) · 8.58 KB
/
config.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
version: 2.1
orbs:
browser-tools: circleci/[email protected]
aliases:
- &save_git_cache
save_cache:
paths:
- .git
key: v3-git-{{ .Revision }}
- &restore_git_cache
restore_cache:
keys:
- v3-git-{{ .Revision }}
- v3-git-
- &save_build_cache
save_cache:
paths:
- build
key: v3-build-{{ .Revision }}
- &restore_build_cache
restore_cache:
keys:
- v3-build-{{ .Revision }}
- &save_dist_cache
save_cache:
paths:
- dist
key: v3-dist-{{ .Revision }}
- &restore_dist_cache
restore_cache:
keys:
- v3-dist-{{ .Revision }}
- &save_npm_cache
save_cache:
paths:
- node_modules
key: v3-npm-{{ checksum "package-lock.json" }}
- &restore_npm_cache
restore_cache:
keys:
- v3-npm-{{ checksum "package-lock.json" }}
- v3-npm-
- &defaults
docker:
- image: cimg/node:12.22.11-browsers
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
working_directory: ~/repo
jobs:
build-test-no-cache:
<<: *defaults
environment:
JEST_JUNIT_OUTPUT_DIR: test-results
NODE_OPTIONS: --max-old-space-size=4000
steps:
- *restore_git_cache
- checkout
- run: npm ci
- run:
name: Lint
command: npm run test:lint -- --quiet --output-file test-results/eslint-results.xml --format junit
- run:
name: Unit
environment:
JEST_JUNIT_OUTPUT_NAME: unit-results.xml
command: npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov --maxWorkers="2"
- run:
name: Build
environment:
NODE_ENV: production
command: npm run build
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Integration
environment:
JEST_JUNIT_OUTPUT_NAME: integration-results.xml
command: |
google-chrome --version
chromedriver --version
npm run test:integration -- --reporters="default" --reporters="jest-junit"
- store_artifacts:
path: coverage
- store_test_results:
path: test-results
setup:
<<: *defaults
steps:
- *restore_git_cache
- checkout
- run: npm ci
- *save_git_cache
- *save_npm_cache
lint:
<<: *defaults
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run:
name: Lint
command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit
- store_test_results:
path: test-results
unit:
<<: *defaults
environment:
JEST_JUNIT_OUTPUT_NAME: results.xml
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run:
name: Unit
environment:
JEST_JUNIT_OUTPUT_DIR: test-results/unit
command: npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov --maxWorkers="2"
- store_artifacts:
path: coverage
- store_test_results:
path: test-results
build:
<<: *defaults
environment:
NODE_ENV: production
NODE_OPTIONS: --max-old-space-size=4000
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run:
name: Build
command: npm run build
- *save_build_cache
- *save_dist_cache
store_build:
<<: *defaults
steps:
- *restore_build_cache
- store_artifacts:
path: build
store_dist:
<<: *defaults
steps:
- *restore_dist_cache
- store_artifacts:
path: dist
integration:
<<: *defaults
parallelism: 2
environment:
JEST_JUNIT_OUTPUT_NAME: results.txt
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- *restore_build_cache
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Integration
environment:
JEST_JUNIT_OUTPUT_DIR: test-results/integration
command: |
google-chrome --version
chromedriver --version
export TESTFILES=$(circleci tests glob "test/integration/*.test.js" | circleci tests split --split-by=timings)
$(npm bin)/jest ${TESTFILES} --reporters="default" --reporters="jest-junit" --runInBand
- store_test_results:
path: test-results
deploy-npm:
<<: *defaults
environment:
NODE_OPTIONS: --max-old-space-size=4000
steps:
- *restore_git_cache
- *restore_dist_cache
- checkout
- run: |
echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV
echo export NPM_TAG=latest >> $BASH_ENV
if [ "$CIRCLE_BRANCH" == "master" ]
then echo export NPM_TAG=stable >> $BASH_ENV
fi
if [[ "$CIRCLE_BRANCH" == hotfix/* ]] # double brackets are important for matching the wildcard
then echo export NPM_TAG=hotfix >> $BASH_ENV
fi
- run: npm version --no-git-tag-version $RELEASE_VERSION
- run: |
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish --tag $NPM_TAG
- run: git tag $RELEASE_VERSION
- run: git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION
deploy-gh-pages:
<<: *defaults
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- *restore_build_cache
- run: |
git config --global user.email $(git log --pretty=format:"%ae" -n1)
git config --global user.name $(git log --pretty=format:"%an" -n1)
- run: npm run deploy -- -e $CIRCLE_BRANCH
push-translations:
<<: *defaults
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run: npm run i18n:src
- run: npm run i18n:push
workflows:
version: 2
push-translations:
triggers:
- schedule:
cron: 0 0 * * * # daily at 12 UTC, 8 ET
filters:
branches:
only:
- develop
jobs:
- setup:
context:
- dockerhub-credentials
- push-translations:
context:
- dockerhub-credentials
requires:
- setup
build-test-no-deploy:
jobs:
- build-test-no-cache:
context:
- dockerhub-credentials
filters:
branches:
ignore:
- master
- develop
- /^hotfix\/.*/
build-test-deploy:
jobs:
- setup:
context:
- dockerhub-credentials
filters:
branches:
only:
- master
- develop
- /^hotfix\/.*/
- lint:
context:
- dockerhub-credentials
requires:
- setup
- unit:
context:
- dockerhub-credentials
requires:
- setup
- build:
context:
- dockerhub-credentials
requires:
- setup
- integration:
context:
- dockerhub-credentials
requires:
- build
- store_build:
context:
- dockerhub-credentials
requires:
- build
filters:
branches:
only:
- master
- develop
- /^hotfix\/.*/
- store_dist:
context:
- dockerhub-credentials
requires:
- build
filters:
branches:
only:
- master
- develop
- /^hotfix\/.*/
- deploy-npm:
context:
- dockerhub-credentials
requires:
- lint
- unit
- integration
- build
filters:
branches:
only:
- master
- develop
- /^hotfix\/.*/
- deploy-gh-pages:
context:
- dockerhub-credentials
requires:
- lint
- unit
- integration
- build
filters:
branches:
ignore:
- /^dependabot/.*/
- /^renovate/.*/
- /^pull/.*/ # don't deploy to gh pages on PRs.