Frames

Untitled

0
1version: 2
2
3aliases:
4 - &docker
5 - image: circleci/openjdk:8-jdk-node-browsers
6
7 - &environment
8 TZ: /usr/share/zoneinfo/America/Los_Angeles
9
10 - &restore_yarn_cache
11 restore_cache:
12 name: Restore node_modules cache
13 keys:
14 - v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
15 - v1-node-{{ arch }}-{{ .Branch }}-
16 - v1-node-{{ arch }}-
17 - &run_yarn
18 run:
19 name: Install Packages
20 command: yarn --frozen-lockfile
21
22 - &attach_workspace
23 at: build
24
25jobs:
26 setup:
27 docker: *docker
28 environment: *environment
29
30 steps:
31 - checkout
32 - run:
33 name: Nodejs Version
34 command: node --version
35 - *restore_yarn_cache
36 - *run_yarn
37 - save_cache:
38 name: Save node_modules cache
39 key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
40 paths:
41 - ~/.cache/yarn
42
43 lint:
44 docker: *docker
45 environment: *environment
46
47 steps:
48 - checkout
49 - *restore_yarn_cache
50 - *run_yarn
51 - run: node ./scripts/prettier/index
52 - run: node ./scripts/tasks/eslint
53 - run: ./scripts/circleci/check_license.sh
54 - run: ./scripts/circleci/check_modules.sh
55 - run: ./scripts/circleci/test_print_warnings.sh
56
57 flow:
58 docker: *docker
59 environment: *environment
60
61 steps:
62 - checkout
63 - *restore_yarn_cache
64 - *run_yarn
65 - run: node ./scripts/tasks/flow-ci
66
67 test_source:
68 docker: *docker
69 environment: *environment
70
71 steps:
72 - checkout
73 - *restore_yarn_cache
74 - *run_yarn
75 - run: yarn test --maxWorkers=2
76
77 test_source_persistent:
78 docker: *docker
79 environment: *environment
80
81 steps:
82 - checkout
83 - *restore_yarn_cache
84 - *run_yarn
85 - run: yarn test-persistent --maxWorkers=2
86
87 test_source_prod:
88 docker: *docker
89 environment: *environment
90
91 steps:
92 - checkout
93 - *restore_yarn_cache
94 - *run_yarn
95 - run: yarn test-prod --maxWorkers=2
96
97 build:
98 docker: *docker
99 environment: *environment
100 parallelism: 20
101 steps:
102 - checkout
103 - *restore_yarn_cache
104 - *run_yarn
105 - run: ./scripts/circleci/add_build_info_json.sh
106 - run: ./scripts/circleci/update_package_versions.sh
107 - run: yarn build
108 - persist_to_workspace:
109 root: build
110 paths:
111 - facebook-www
112 - node_modules
113 - react-native
114 - dist
115 - sizes/*.json
116
117 process_artifacts:
118 docker: *docker
119 environment: *environment
120 steps:
121 - checkout
122 - attach_workspace: *attach_workspace
123 - *restore_yarn_cache
124 - *run_yarn
125 - run: node ./scripts/rollup/consolidateBundleSizes.js
126 - run: node ./scripts/tasks/danger
127 - run: ./scripts/circleci/upload_build.sh
128 - run: ./scripts/circleci/pack_and_store_artifact.sh
129 - store_artifacts:
130 path: ./node_modules.tgz
131 - store_artifacts:
132 path: ./build.tgz
133 - store_artifacts:
134 path: ./build/bundle-sizes.json
135 - store_artifacts:
136 # TODO: Update release script to use local file instead of pulling
137 # from artifacts.
138 path: ./scripts/error-codes/codes.json
139
140 lint_build:
141 docker: *docker
142 environment: *environment
143 steps:
144 - checkout
145 - attach_workspace: *attach_workspace
146 - *restore_yarn_cache
147 - *run_yarn
148 - run: yarn lint-build
149 - run: scripts/circleci/check_minified_errors.sh
150
151 test_build:
152 docker: *docker
153 environment: *environment
154 steps:
155 - checkout
156 - attach_workspace: *attach_workspace
157 - *restore_yarn_cache
158 - *run_yarn
159 - run: yarn test-build --maxWorkers=2
160
161 test_dom_fixtures:
162 docker: *docker
163 environment: *environment
164 steps:
165 - checkout
166 - attach_workspace: *attach_workspace
167 - *restore_yarn_cache
168 - run:
169 name: Run DOM fixture tests
170 command: |
171 cd fixtures/dom
172 yarn --frozen-lockfile
173 yarn prestart
174 yarn test --maxWorkers=2
175
176 test_fuzz:
177 docker: *docker
178 environment: *environment
179 steps:
180 - checkout
181 - *restore_yarn_cache
182 - *run_yarn
183 - run:
184 name: Run fuzz tests
185 command: |
186 FUZZ_TEST_SEED=$RANDOM yarn test fuzz --maxWorkers=2
187 FUZZ_TEST_SEED=$RANDOM yarn test-prod fuzz --maxWorkers=2
188
189 test_build_prod:
190 docker: *docker
191 environment: *environment
192 steps:
193 - checkout
194 - attach_workspace: *attach_workspace
195 - *restore_yarn_cache
196 - *run_yarn
197 - run: yarn test-build-prod --maxWorkers=2
198
199workflows:
200 version: 2
201 commit:
202 jobs:
203 - setup
204 - lint:
205 requires:
206 - setup
207 - flow:
208 requires:
209 - setup
210 - test_source:
211 requires:
212 - setup
213 - test_source_prod:
214 requires:
215 - setup
216 - test_source_persistent:
217 requires:
218 - setup
219 - build:
220 requires:
221 - setup
222 - process_artifacts:
223 requires:
224 - build
225 - lint_build:
226 requires:
227 - build
228 - test_build:
229 requires:
230 - build
231 - test_build_prod:
232 requires:
233 - build
234 - test_dom_fixtures:
235 requires:
236 - build
237 hourly:
238 triggers:
239 - schedule:
240 cron: "0 * * * *"
241 filters:
242 branches:
243 only:
244 - master
245 jobs:
246 - setup
247 - test_fuzz:
248 requires:
249 - setup
250