/
config.yml
172 lines (155 loc) · 4.56 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
version: 2
aliases:
- &docker-node-lts
- image: circleci/node:lts
- &docker-node-browsers
- image: circleci/node:8.10.0-browsers
environment:
CHROME_BIN: "/usr/bin/google-chrome"
- &restore-node-modules-cache
name: Restore node_modules cache
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
- &restore-yarn-cache
name: Restore yarnpkg cache
key: v1-yarn-cache
- &save-node-modules-cache
name: Save node_modules cache
paths:
- node_modules
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
- &save-yarn-cache
name: Save yarnpkg cache
paths:
- ~/.cache/yarn
key: v1-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/tslint ./reports/stylelint
- 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:libs
- run: yarn dist:apps
- persist_to_workspace:
root: '.'
paths: [packages/*/dist]
test-react-16: &test-react
docker: *docker-node-browsers
environment:
JUNIT_REPORT_PATH: reports
parallelism: 3
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: mkdir ./reports
- run:
command: |
case $CIRCLE_NODE_INDEX in \
0) yarn lerna run --parallel test:pre ;; \
1) yarn lerna run --parallel test:iso ;; \
2) yarn lerna run --parallel 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
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]
- deploy-preview:
requires: [dist]
- deploy-npm:
requires: [dist, lint, test-react-15, test-react-16]
filters:
branches:
only:
- develop
- next
- /^release\/.*/