1
- # Javascript Node CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4
- #
5
1
version : 2
6
- jobs :
7
- build :
8
- docker :
9
- # specify the version you desire here
10
- - image : circleci/node:7.10
11
-
12
- # Specify service dependencies here if necessary
13
- # CircleCI maintains a library of pre-built images
14
- # documented at https://circleci.com/docs/2.0/circleci-images/
15
- # - image: circleci/mongo:3.4.4
16
2
17
- working_directory : ~/javascript-excel
3
+ aliases :
4
+ - &defaults
5
+ working_directory : ~/javascript-excel
6
+ - &node6_executor
7
+ docker :
8
+ - image : circleci/node:6
9
+ - &node8_executor
10
+ docker :
11
+ - image : circleci/node:8
12
+ - &node9_executor
13
+ docker :
14
+ - image : circleci/node:9
15
+ - &node10_executor
16
+ docker :
17
+ - image : circleci/node:10
18
+ - &default_executor
19
+ << : *node9_executor
20
+ - &repo_key
21
+ repo-{{ .Branch }}-{{ .Revision }}
22
+ - &coverage_key
23
+ coverage-{{ .Branch }}-{{ .Revision }}
24
+ - &base_config_key
25
+ base-config-{{ .Branch }}-{{ .Revision }}
26
+ - &restore_repo
27
+ restore_cache :
28
+ keys :
29
+ - *repo_key
30
+ - &ignore_non_dev_branches
31
+ filters :
32
+ tags :
33
+ only : /.*/
34
+ branches :
35
+ ignore :
36
+ - /release\/.*/
37
+ - &execute_on_release
38
+ filters :
39
+ tags :
40
+ only : /(v)?[0-9]+(\.[0-9]+)*/
41
+ branches :
42
+ ignore :
43
+ - /.*/
18
44
45
+ jobs :
46
+ prepare :
47
+ << : *defaults
48
+ << : *default_executor
19
49
steps :
50
+ - *restore_repo
20
51
- checkout
21
-
22
- # Download and cache dependencies
23
52
- restore_cache :
24
- keys :
25
- - v1-dependencies-{{ checksum "package.json" }}
26
- # fallback to using the latest cache if no exact match is found
27
- - v1-dependencies-
53
+ key : *base_config_key
54
+ - run :
55
+ name : Install Js dependencies
56
+ command : yarn install --no-progress
57
+ - run :
58
+ name : Build project
59
+ command : yarn run build
60
+ - save_cache :
61
+ key : *repo_key
62
+ paths :
63
+ - ~/javascript-excel
28
64
29
- - run : yarn install
65
+ test_node6 :
66
+ << : *defaults
67
+ << : *node6_executor
68
+ steps :
69
+ - *restore_repo
70
+ - run :
71
+ name : Test with Node 6
72
+ command : yarn run test
30
73
74
+ test_node8 :
75
+ << : *defaults
76
+ << : *node8_executor
77
+ steps :
78
+ - *restore_repo
79
+ - run :
80
+ name : Test with Node 8
81
+ command : |
82
+ yarn test
83
+
84
+ test_node9 :
85
+ << : *defaults
86
+ << : *default_executor
87
+ steps :
88
+ - *restore_repo
89
+ - run :
90
+ name : Test with Node 9
91
+ command : |
92
+ yarn test
31
93
- save_cache :
94
+ key : *coverage_key
32
95
paths :
33
- - node_modules
34
- key : v1-dependencies-{{ checksum "package.json" }}
96
+ - coverage
35
97
36
- # run tests!
37
- - run : yarn test
98
+ test_node10 :
99
+ << : *defaults
100
+ << : *node10_executor
101
+ steps :
102
+ - *restore_repo
103
+ - run :
104
+ name : Test with Node 10
105
+ command : |
106
+ yarn run test
38
107
108
+ test_size :
109
+ << : *defaults
110
+ << : *default_executor
111
+ steps :
112
+ - *restore_repo
113
+ - run :
114
+ name : Test size
115
+ command : yarn test:size
116
+
117
+ coverage :
118
+ << : *defaults
119
+ << : *default_executor
120
+ steps :
121
+ - *restore_repo
122
+ - restore_cache :
123
+ key : *coverage_key
124
+ - run :
125
+ name : Publish coverage
126
+ command : yarn run coverage:publish
127
+ - store_artifacts :
128
+ path : coverage/clover.xml
129
+ prefix : tests
130
+ - store_artifacts :
131
+ path : coverage
132
+ prefix : coverage
133
+ - store_test_results :
134
+ path : coverage/clover.xml
39
135
136
+ workflows :
137
+ version : 2
138
+ workflow :
139
+ jobs :
140
+ - prepare :
141
+ << : *ignore_non_dev_branches
142
+ - test_node6 :
143
+ requires :
144
+ - prepare
145
+ << : *ignore_non_dev_branches
146
+ - test_node8 :
147
+ requires :
148
+ - prepare
149
+ << : *ignore_non_dev_branches
150
+ - test_node9 :
151
+ requires :
152
+ - prepare
153
+ << : *ignore_non_dev_branches
154
+ - test_node10 :
155
+ requires :
156
+ - prepare
157
+ << : *ignore_non_dev_branches
158
+ - coverage :
159
+ requires :
160
+ - test_node6
161
+ - test_node8
162
+ - test_node9
163
+ - test_node10
164
+ - test_size
165
+ << : *ignore_non_dev_branches
0 commit comments