forked from palantir/blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
202 lines (183 loc) · 5.82 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
version: 2
aliases:
- &docker-node-lts
- image: circleci/node:lts
- &docker-node-browsers
- image: circleci/node:lts-browsers
environment:
CHROME_BIN: "/usr/bin/google-chrome"
- &restore-node-modules-cache
name: Restore node_modules cache
key: v2-yarn-deps-{{ checksum "yarn.lock" }}
- &restore-yarn-cache
name: Restore yarnpkg cache
key: v2-yarn-cache
- &save-node-modules-cache
name: Save node_modules cache
paths:
- node_modules
key: v2-yarn-deps-{{ checksum "yarn.lock" }}
- &save-yarn-cache
name: Save yarnpkg cache
paths:
- ~/.cache/yarn
key: v2-yarn-cache
references:
reports_path: &reports_path
path: ./reports
jobs:
checkout-code:
docker: *docker-node-lts
steps:
- checkout
- restore_cache: *restore-yarn-cache
- restore_cache: *restore-node-modules-cache
- run: yarn install --non-interactive --cache-folder ~/.cache/yarn
- run:
name: Check if yarn.lock changed during install
command: git diff --exit-code
- save_cache: *save-node-modules-cache
- save_cache: *save-yarn-cache
- persist_to_workspace:
root: '.'
paths: [packages/*/node_modules]
clean-lockfile:
docker: *docker-node-lts
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- run: ./scripts/verifyCleanLockfile.sh
compile:
docker: *docker-node-lts
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: yarn compile
- persist_to_workspace:
root: '.'
paths: [packages/*/lib, packages/*/src/generated]
lint:
docker: *docker-node-lts
environment:
JUNIT_REPORT_PATH: reports
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: mkdir -p ./reports/eslint ./reports/stylelint
# we need to compile the lint rules for blueprint
- run: yarn compile --scope "@blueprintjs/tslint-config"
- run: yarn lint
- store_test_results: { path: ./reports }
- store_artifacts: { path: ./reports }
dist:
docker: *docker-node-lts
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: yarn dist
- persist_to_workspace:
root: '.'
paths: [packages/*/lib, packages/*/dist]
test-react-16: &test-react
docker: *docker-node-browsers
environment:
JUNIT_REPORT_PATH: reports
parallelism: 6
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: mkdir ./reports
- run:
# split karma tests into containers because they can take up a lot of memory
# running them in one container caused Karma to time out frequently
# see https://github.com/palantir/blueprint/issues/3616
command: |
case $CIRCLE_NODE_INDEX in \
0) yarn lerna run --parallel test:typeCheck ;; \
1) yarn lerna run --scope "@blueprintjs/core" test:karma ;; \
2) yarn lerna run --scope "@blueprintjs/datetime" test:karma ;; \
3) yarn lerna run --scope "@blueprintjs/select" test:karma ;; \
4) yarn lerna run --scope "@blueprintjs/table" test:karma ;; \
5) yarn lerna run --scope "@blueprintjs/timezone" test:karma ;; \
esac
when: always
- store_test_results: { path: ./reports }
- store_artifacts: { path: ./reports }
test-react-15:
# copy test-react-16 and override environment
<<: *test-react
environment:
JUNIT_REPORT_PATH: reports
REACT: 15 # use React 15 for this job
test-iso-react-16: &test-iso
docker: *docker-node-lts
environment:
JUNIT_REPORT_PATH: reports
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: mkdir ./reports
- run: yarn lerna run --parallel test:iso
- store_test_results: { path: ./reports }
- store_artifacts: { path: ./reports }
test-iso-react-15:
# copy test-iso-react-16 and override environment
<<: *test-iso
environment:
JUNIT_REPORT_PATH: reports
REACT: 15 # use React 15 for this job
deploy-preview:
docker: *docker-node-lts
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- store_artifacts: { path: packages/docs-app/dist }
- store_artifacts: { path: packages/landing-app/dist }
- store_artifacts: { path: packages/table-dev-app/dist }
- run:
name: Submit Github comment with links to built artifacts
command: node ./scripts/preview.js
deploy-npm:
docker: *docker-node-lts
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: ./scripts/publish-npm-semver-tagged
workflows:
version: 2
compile_lint_test_dist_deploy:
jobs:
- checkout-code
- clean-lockfile:
requires: [checkout-code]
- compile:
requires: [checkout-code]
- lint:
requires: [checkout-code]
- dist:
requires: [compile]
- test-react-15:
requires: [compile]
- test-react-16:
requires: [compile]
- test-iso-react-15:
requires: [compile]
- test-iso-react-16:
requires: [compile]
- deploy-preview:
requires: [dist]
- deploy-npm:
requires: [dist, lint, test-react-15, test-react-16, test-iso-react-15, test-iso-react-16]
filters:
branches:
only:
- develop
- next
- /^release\/.*/