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