1 |
|
2 | version: 2
|
3 |
|
4 | general:
|
5 | branches:
|
6 | ignore:
|
7 | - gh-pages
|
8 |
|
9 | jobs:
|
10 | install_and_test:
|
11 | working_directory: ~/nested-react-components
|
12 | docker:
|
13 |
|
14 | - image: circleci/node:8.7
|
15 | steps:
|
16 | - checkout
|
17 | - restore_cache:
|
18 | keys:
|
19 | - v1-dependency-cache-{{ arch }}-{{ checksum "yarn.lock" }}
|
20 | - v1-dependency-cache-{{ arch }}
|
21 | - run: yarn install --pure-lockfile
|
22 | - save_cache:
|
23 | key: v1-dependency-cache-{{ arch }}-{{ checksum "yarn.lock" }}
|
24 | paths:
|
25 | - node_modules
|
26 | - run: echo 'export PATH=$HOME/nested-react-components/node_modules/.bin:$PATH' >> $BASH_ENV
|
27 | - run: builder run check
|
28 |
|
29 | - run: yarn build
|
30 |
|
31 | build_and_publish:
|
32 | working_directory: ~/nested-react-components
|
33 | docker:
|
34 | - image: circleci/node:8.7
|
35 | steps:
|
36 | - checkout
|
37 | - restore_cache:
|
38 | keys:
|
39 | - v1-dependency-cache-{{ arch }}-{{ checksum "yarn.lock" }}
|
40 | - v1-dependency-cache-{{ arch }}
|
41 | - run: echo 'export PATH=$HOME/nested-react-components/node_modules/.bin:$PATH' >> $BASH_ENV
|
42 | - run: yarn build
|
43 | - run: semantic-release
|
44 |
|
45 |
|
46 |
|
47 | check_bundlesize:
|
48 | working_directory: ~/nested-react-components
|
49 | docker:
|
50 | - image: circleci/node:8.7
|
51 | steps:
|
52 | - checkout
|
53 | - restore_cache:
|
54 | keys:
|
55 | - v1-dependency-cache-{{ arch }}-{{ checksum "yarn.lock" }}
|
56 | - v1-dependency-cache-{{ arch }}
|
57 | - run: echo 'export PATH=$HOME/nested-react-components/node_modules/.bin:$PATH' >> $BASH_ENV
|
58 | - run: yarn build
|
59 | - run: yarn bundlesize
|
60 |
|
61 | run_visual_tests:
|
62 | working_directory: ~/nested-react-components
|
63 | docker:
|
64 | - image: circleci/node:8.7
|
65 | steps:
|
66 | - checkout
|
67 | - restore_cache:
|
68 | keys:
|
69 | - v1-dependency-cache-{{ arch }}-{{ checksum "yarn.lock" }}
|
70 | - v1-dependency-cache-{{ arch }}
|
71 | - run: echo 'export PATH=$HOME/nested-react-components/node_modules/.bin:$PATH' >> $BASH_ENV
|
72 | - run: yarn run chromatic --exit-zero-on-changes
|
73 |
|
74 | approve_visual_tests:
|
75 | working_directory: ~/nested-react-components
|
76 | docker:
|
77 | - image: circleci/node:8.7
|
78 | steps:
|
79 | - checkout
|
80 | - restore_cache:
|
81 | keys:
|
82 | - v1-dependency-cache-{{ arch }}-{{ checksum "yarn.lock" }}
|
83 | - v1-dependency-cache-{{ arch }}
|
84 | - run: echo 'export PATH=$HOME/nested-react-components/node_modules/.bin:$PATH' >> $BASH_ENV
|
85 | - run: yarn run chromatic --auto-accept-changes
|
86 |
|
87 | workflows:
|
88 | version: 2
|
89 | main:
|
90 | jobs:
|
91 | - install_and_test
|
92 | - run_visual_tests:
|
93 | requires:
|
94 | - install_and_test
|
95 | - check_bundlesize
|
96 | filters:
|
97 | branches:
|
98 | ignore: master
|
99 | - approve_visual_tests:
|
100 | requires:
|
101 | - install_and_test
|
102 | - check_bundlesize
|
103 | filters:
|
104 | branches:
|
105 | only: master
|
106 | - check_bundlesize:
|
107 | requires:
|
108 | - install_and_test
|
109 | - build_and_publish:
|
110 | requires:
|
111 | - install_and_test
|
112 | - check_bundlesize
|
113 | - approve_visual_tests
|
114 | filters:
|
115 | branches:
|
116 | only: master
|