11version : 2
22
3- defaults : &defaults
4- working_directory : ~/project/react-stick
5- docker :
6- - image : circleci/node:latest-browsers
7- environment :
8- CHROME_BIN : ' /usr/bin/google-chrome'
9-
10- attach_workspace : &attach_workspace
11- attach_workspace :
12- at : ~/project
13-
14- restore_cache : &restore_cache
15- restore_cache :
16- name : Restore node_modules cache
17- keys :
18- - v1-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
19- - v1-node-{{ .Branch }}-
20- - v1-node-
3+ references :
4+ defaults : &defaults
5+ working_directory : ~/repo
6+ docker :
7+ - image : circleci/node:latest-browsers
8+ environment :
9+ CHROME_BIN : " /usr/bin/google-chrome"
10+
11+ restore_cache : &restore_cache
12+ restore_cache :
13+ keys :
14+ - deps-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
15+ - deps-v1-{{ .Branch }}
16+ - deps-v1
2117
2218jobs :
2319 install :
2420 << : *defaults
21+
2522 steps :
2623 - checkout
27- - *attach_workspace
24+
2825 - *restore_cache
29- - run :
30- name : Install Dependencies
31- command : yarn install --frozen-lockfile
32- - save_cache :
33- name : Save yarn cache
34- key : v1-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}
35- paths :
36- - .cache/yarn
26+
27+ - run : yarn
28+
3729 - save_cache :
38- name : Save node_modules cache
39- key : v1-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
40- paths :
41- - node_modules/
42- - run :
43- name : Remove node_modules to cleanup workspace
44- command : rm -r node_modules/
45- - persist_to_workspace :
46- root : ~/project
30+ key : deps-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
4731 paths :
48- - react-stick
32+ - node_modules
4933
5034 lint :
5135 << : *defaults
36+
5237 steps :
53- - *attach_workspace
38+ - checkout
39+
5440 - *restore_cache
41+
5542 - run :
5643 name : Lint
5744 command : yarn lint
5845
5946 flow :
6047 << : *defaults
48+
6149 steps :
62- - *attach_workspace
50+ - checkout
51+
6352 - *restore_cache
53+
6454 - run :
6555 name : Flow
6656 command : yarn flow
6757
6858 test :
6959 << : *defaults
7060 steps :
71- - *attach_workspace
61+ - checkout
62+
7263 - *restore_cache
64+
7365 - run :
7466 name : Test
7567 command : yarn test:coverage
68+
7669 - run :
7770 name : Codecov
7871 command : bash <(curl -s https://codecov.io/bash)
7972
8073 publish-demo :
8174 << : *defaults
8275 steps :
83- - *attach_workspace
76+ - checkout
77+
8478 - *restore_cache
79+
8580 - run :
8681 name : Fix host authenticity for github.com
8782 command : mkdir -p ~/.ssh/ && ssh-keyscan github.com >> ~/.ssh/known_hosts
10297 release-preview :
10398 << : *defaults
10499 steps :
105- - *attach_workspace
100+ - checkout
106101 - *restore_cache
107102 - run :
108103 name : Post release preview
@@ -111,7 +106,7 @@ jobs:
111106 release :
112107 << : *defaults
113108 steps :
114- - *attach_workspace
109+ - checkout
115110 - *restore_cache
116111 - run :
117112 name : Fix host authenticity for github.com
0 commit comments