-
Notifications
You must be signed in to change notification settings - Fork 23
/
.gitlab-ci.yml
91 lines (83 loc) · 1.56 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
image: node:lts
cache:
paths:
# - node_modules/
# wait for https://gitlab.com/gitlab-org/gitlab-runner/issues/2620
# - packages/**/node_modules/
# - examples/sample/node_modules/
stages:
- test
- test:cov
- build
- release
- deploy
before_script:
- npx envinfo --registry https://registry.npmmirror.com/
- yarn install --registry https://registry.npmmirror.com/
- cd examples/sample
- yarn install --registry https://registry.npmmirror.com/
- cd ../..
build:
stage: build
script:
- npm run build
tags:
- docker
build-on-node-latest:
image: node:latest
stage: build
script:
- npm run build
tags:
- docker
coverage:
stage: test:cov
# https://ac.gerrit.sodajs.org/fe/common-docker
image: node:lts
coverage: '/^Lines\s*: (\d+\.\d+)%/'
script:
- npm run build:dev # to test coverage, don't minify code
- npm run test:cov
artifacts:
paths:
- coverage/
expire_in: 2 weeks
tags:
- docker
test:
stage: test
image: node:lts
script:
- npm run build
- npm run prettier-check
- npm run test
tags:
- docker
pack:
stage: release
script:
- npm run build
- npm run pack
- npm run pack-sourcemaps
artifacts:
name: 'hap-toolkit-$CI_COMMIT_REF_NAME'
paths:
- 'packages/*/*.tgz'
expire_in: 2 weeks
tags:
- docker
only:
- tag
# not supported now
#pages:
# stage: deploy
# dependencies:
# - coverage
# script:
# - mv coverage/ public/
# artifacts:
# paths:
# - public
# expire_in: 90 days
# tags:
# - docker