-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
137 lines (122 loc) · 2.71 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
130
131
132
133
134
135
136
137
# .gitlab-ci.yml
default:
image: node:lts-alpine
variables:
FF_USE_FASTZIP: 'true'
# These can be specified per job or per pipeline
ARTIFACT_COMPRESSION_LEVEL: 'fast'
CACHE_COMPRESSION_LEVEL: 'fast'
stages:
- install_deps
- build
# - install_deps_demo
# - build_demo
# - lint
# - test
- deploy
# Caches
.node_modules-cache: &node_modules-cache
key:
files:
- yarn.lock
paths:
- node_modules
policy: pull
.node_modules-cache-demo: &node_modules-cache-demo
key:
files:
- demo/yarn.lock
paths:
- demo/node_modules
policy: pull
.yarn-cache: &yarn-cache
key: yarn-$CI_JOB_IMAGE
paths:
- .yarn
.yarn-cache-demo: &yarn-cache-demo
key: yarn-demo-$CI_JOB_IMAGE
paths:
- demo/.yarn
.test-cache: &test-cache
key: test-$CI_JOB_IMAGE
paths:
- .jestcache
- demo/.jestcache
policy: pull-push
.build-cache: &build-cache
key: build-$CI_JOB_IMAGE
paths:
- .cache
- build
policy: pull-push
Install Dependencies:
stage: install_deps
script:
- yarn install --cache-folder .yarn
cache:
- <<: *node_modules-cache
policy: pull-push # We override the policy
- <<: *yarn-cache # This is not required if your internet speed is good or if you use a local npm registry.
# Install Demo Dependencies:
# stage: install_deps_demo
# script:
# - cd demo
# - yarn install --cache-folder .yarn
# cache:
# - <<: *build-cache
# - <<: *node_modules-cache-demo
# policy: pull-push # We override the policy
# - <<: *yarn-cache-demo # This is not required if your internet speed is good or if you use a local npm registry.
Build:
stage: build
script:
- yarn build
cache:
- <<: *node_modules-cache
- <<: *build-cache
artifacts:
paths:
- dist
# # Webpack build is really slow
# Build Demo:
# stage: build_demo
# # Webpack build is really slow, so only running this for releases
# # to verify the SDK can be imported correctly
# only:
# - tags
# script:
# - cd demo
# - yarn build
# cache:
# - <<: *node_modules-cache-demo
# Lint:
# stage: lint
# script:
# - yarn lint
# - yarn format:check
# cache:
# - <<: *node_modules-cache
# - <<: *node_modules-cache-demo
# Test:
# stage: test
# script:
# - yarn test --cacheDirectory ".jestcache"
# - cd demo
# - yarn test --cacheDirectory ".jestcache"
# cache:
# - <<: *node_modules-cache
# - <<: *node_modules-cache-demo
# - <<: *test-cache
Deploy:
stage: deploy
only:
- tags
script:
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- npm publish --access public
cache:
- <<: *node_modules-cache
- <<: *build-cache
artifacts:
paths:
- dist