1
1
version : 2
2
2
3
3
aliases :
4
+ - &repo_path
5
+ ~/ui-theme
4
6
- &defaults
5
- working_directory : ~/ui-theme
6
- - &node11_executor
7
+ working_directory : *repo_path
8
+ - &node_latest_executor
7
9
docker :
8
- - image : circleci/node:11.10.1
9
- - &node8_executor
10
+ - image : circleci/node:latest
11
+ - &node_lts_executor
10
12
docker :
11
- - image : circleci/node:8
12
- - &node10_executor
13
+ - image : circleci/node:lts
14
+ - &node_8_executor
13
15
docker :
14
- - image : circleci/node:10
16
+ - image : circleci/node:8
15
17
- &default_executor
16
- << : *node10_executor
17
- - &repo_key
18
- repo-{{ .Branch }}-{{ .Revision }}
19
- - &coverage_key
20
- coverage-{{ .Branch }}-{{ .Revision }}
21
- - &base_config_key
22
- base-config-{{ .Branch }}-{{ .Revision }}
18
+ << : *node_latest_executor
23
19
- &yarn_cache_key
24
20
yarn-sha-{{ checksum "yarn.lock" }}
21
+ - &coverage_key
22
+ coverage-{{ .Branch }}-{{ .Revision }}
25
23
- &restore_repo
26
- restore_cache :
27
- keys :
28
- - *repo_key
24
+ attach_workspace :
25
+ at : *repo_path
29
26
- &ignore_non_dev_branches
30
27
filters :
31
28
tags :
@@ -36,7 +33,7 @@ aliases:
36
33
- &execute_on_release
37
34
filters :
38
35
tags :
39
- only : /(v) ?[0-9]+(\.[0-9]+)*/
36
+ only : /v ?[0-9]+(\.[0-9]+)*([-+\.][a-zA-Z0 -9]+)*/
40
37
branches :
41
38
ignore :
42
39
- /.*/
@@ -48,21 +45,11 @@ jobs:
48
45
steps :
49
46
- *restore_repo
50
47
- checkout
51
- - restore_cache :
52
- key : *base_config_key
53
- - run :
54
- name : ' Base environment setup'
55
- command : echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
56
- - save_cache :
57
- key : *base_config_key
58
- paths :
59
- - ~/.npmrc
60
- - ~/.gitconfig
61
48
- restore_cache :
62
49
key : *yarn_cache_key
63
50
- run :
64
- name : Install Js dependencies
65
- command : yarn install --no-progress --registry https://registry.verdaccio.org --no -lockfile
51
+ name : Install dependencies
52
+ command : yarn install --frozen -lockfile
66
53
- run :
67
54
name : Build project
68
55
command : yarn run build
@@ -72,10 +59,20 @@ jobs:
72
59
- ~/.yarn
73
60
- ~/.cache/yarn
74
61
- node_modules
75
- - save_cache :
76
- key : *repo_key
62
+ - persist_to_workspace :
63
+ root : *repo_path
77
64
paths :
78
- - ~/ui-theme
65
+ - ./*
66
+
67
+ lint :
68
+ << : *defaults
69
+ << : *default_executor
70
+ steps :
71
+ - *restore_repo
72
+ - run :
73
+ name : Lint code
74
+ command : yarn lint
75
+
79
76
test_bundlesize :
80
77
<< : *defaults
81
78
<< : *default_executor
@@ -85,36 +82,36 @@ jobs:
85
82
name : Test BundleSize
86
83
command : yarn test:size
87
84
88
- test_node11 :
85
+ test_node_latest :
89
86
<< : *defaults
90
- << : *node11_executor
87
+ << : *node_latest_executor
91
88
steps :
92
89
- *restore_repo
93
90
- run :
94
- name : Test with Node 11
91
+ name : Test with Node (Latest)
95
92
command : yarn test
93
+ - save_cache :
94
+ key : *coverage_key
95
+ paths :
96
+ - coverage
96
97
97
- test_node8 :
98
+ test_node_lts :
98
99
<< : *defaults
99
- << : *node8_executor
100
+ << : *node_lts_executor
100
101
steps :
101
102
- *restore_repo
102
103
- run :
103
- name : Test with Node 8
104
+ name : Test with Node (LTS)
104
105
command : yarn test
105
106
106
- test_node10 :
107
+ test_node_8 :
107
108
<< : *defaults
108
- << : *node10_executor
109
+ << : *node_8_executor
109
110
steps :
110
111
- *restore_repo
111
112
- run :
112
- name : Test with Node 10
113
+ name : Test with Node (8)
113
114
command : yarn run test
114
- - save_cache :
115
- key : *coverage_key
116
- paths :
117
- - coverage
118
115
119
116
coverage :
120
117
<< : *defaults
@@ -140,8 +137,9 @@ jobs:
140
137
<< : *default_executor
141
138
steps :
142
139
- *restore_repo
143
- - restore_cache :
144
- key : *base_config_key
140
+ - run :
141
+ name : ' Setup publish credentials'
142
+ command : echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
145
143
- run :
146
144
name : Publish
147
145
command : yarn publish
@@ -152,29 +150,36 @@ workflows:
152
150
jobs :
153
151
- prepare :
154
152
<< : *ignore_non_dev_branches
155
- - test_node11 :
153
+ - lint :
156
154
requires :
157
155
- prepare
158
156
<< : *ignore_non_dev_branches
159
- - test_node8 :
157
+ - test_bundlesize :
160
158
requires :
161
159
- prepare
162
160
<< : *ignore_non_dev_branches
163
- - test_node10 :
161
+ - test_node_latest :
164
162
requires :
165
163
- prepare
166
164
<< : *ignore_non_dev_branches
167
- - test_bundlesize :
165
+ - test_node_lts :
168
166
requires :
169
- - test_node11
170
- - test_node8
171
- - test_node10
167
+ - prepare
168
+ << : *ignore_non_dev_branches
169
+ - test_node_8 :
170
+ requires :
171
+ - prepare
172
172
<< : *ignore_non_dev_branches
173
173
- coverage :
174
174
requires :
175
- - test_bundlesize
175
+ - test_node_latest
176
176
<< : *ignore_non_dev_branches
177
177
- publish_package :
178
178
requires :
179
+ - lint
180
+ - test_bundlesize
181
+ - test_node_latest
182
+ - test_node_lts
183
+ - test_node_8
179
184
- coverage
180
185
<< : *execute_on_release
0 commit comments