forked from prettier/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
129 lines (117 loc) · 2.59 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
aliases:
# Cache management
- &restore_yarn_cache
restore_cache:
keys:
- v1-yarn-cache
- &save_yarn_cache
save_cache:
paths:
- ~/.cache/yarn
key: v1-yarn-cache
- &restore_deps_cache
restore_cache:
keys:
- v1-deps-cache-{{ checksum "yarn.lock" }}
- &save_deps_cache
save_cache:
paths:
- node_modules
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
- &restore_build_cache
restore_cache:
keys:
- v1-build-cache-{{ .Branch }}
- v1-build-cache-master
- &save_build_cache
save_cache:
paths:
- .cache
key: v1-build-cache-{{ .Branch }}
# Default
- &defaults
working_directory: ~/prettier
docker:
- image: circleci/node:9
version: 2
jobs:
# Install dependencies and cache everything
checkout_code:
<<: *defaults
steps:
- checkout
- *restore_yarn_cache
- *restore_deps_cache
- run: yarn install
- run: yarn check-deps
- *save_deps_cache
- *save_yarn_cache
- persist_to_workspace:
root: .
paths:
- .
# Create the production bundle and cache
build_prod:
<<: *defaults
environment:
NODE_ENV: production
steps:
- attach_workspace:
at: ~/prettier
- *restore_build_cache
- run: yarn build
- *save_build_cache
- persist_to_workspace:
root: .
paths:
- dist
- store_artifacts:
path: ~/prettier/dist
# Run tests on the production bundle
test_prod_node4:
<<: *defaults
docker:
- image: circleci/node:4
steps:
- attach_workspace:
at: ~/prettier
- run: yarn test:dist
# Run tests on the production bundle
test_prod_node9:
<<: *defaults
steps:
- attach_workspace:
at: ~/prettier
- run:
command: yarn test:dist
environment:
REPORT_SUMMARIES: 1
- store_test_results:
path: test-results
# Run tests using the standalone build
test_prod_standalone:
<<: *defaults
steps:
- attach_workspace:
at: ~/prettier
- run:
command: yarn test:dist
environment:
TEST_STANDALONE: 1
workflows:
version: 2
prod:
jobs:
- checkout_code
- build_prod:
requires:
- checkout_code
- test_prod_node4:
requires:
- build_prod
- test_prod_node9:
requires:
- build_prod
- test_prod_standalone:
requires:
- build_prod