forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
273 lines (272 loc) · 7.68 KB
/
config.yml
File metadata and controls
273 lines (272 loc) · 7.68 KB
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
version: 2
# Adapted from https://github.com/circleci/circleci-docs/blob/master/.circleci/config.yml
# I'd love to find docs on this syntax.
references:
js_deps_paths: &js_deps_paths
- node_modules/
- packages/react-charts/node_modules/
- packages/react-core/node_modules/
- packages/react-console/node_modules/
- packages/react-docs/node_modules/
- packages/react-docs/plugins/gatsby-transformer-react-docgen-typescript/node_modules/
- packages/react-inline-edit-extension/node_modules/
- packages/react-integration/demo-app-ts/node_modules/
- packages/react-integration/node_modules/
- packages/react-styles/node_modules/
- packages/react-table/node_modules/
- packages/react-tokens/node_modules/
- packages/react-topology/node_modules/
- packages/react-virtualized-extension/node_modules/
- packages/react-catalog-view-extension/node_modules/
- packages/react-codemods/node_modules/
- packages/react-icons/node_modules/
- packages/react-datetime/node_modules/
build_cache_paths: &build_cache_paths
- packages/react-charts/dist/
- packages/react-core/dist/
- packages/react-console/dist/
- packages/react-inline-edit-extension/dist/
- packages/react-styles/css/
- packages/react-styles/dist/
- packages/react-table/dist/
- packages/react-tokens/dist/
- packages/react-topology/dist/
- packages/react-virtualized-extension/dist/
- packages/react-catalog-view-extension/dist/
- packages/react-icons/dist/
- packages/react-datetime/dist/
webpack_cache_paths: &webpack_cache_paths
- packages/react-docs/.cache
lint_cache_paths: &lint_cache_paths
- .eslintcache
js_deps_cache_key: &js_deps_cache_key
js-deps-v{{.Environment.CACHE_VERSION}}-{{checksum "yarn.lock"}}
cypress_cache_key: &cypress_cache_key
cypress-v{{.Environment.CACHE_VERSION}}-{{checksum "yarn.lock"}}
webpack_cache_key: &webpack_cache_key
webpack-v{{.Environment.CACHE_VERSION}}-{{checksum "yarn.lock"}}
build_cache_key: &build_cache_key
build-cache-v{{.Environment.CACHE_VERSION}}-{{checksum "yarn.lock"}}
lint_cache_key: &lint_cache_key
lint-cache-v{{.Environment.CACHE_VERSION}}-{{checksum "package.json"}}
attach_workspace: &attach_workspace
attach_workspace:
at: ~/project
workflows:
version: 2
build_test_deploy:
jobs:
- build_pf4
- build_docs_pf4:
requires:
- build_pf4
- test_jest_pf4:
requires:
- build_pf4
- lint_pf4:
requires:
- build_pf4
- build_demo_app:
requires:
- build_pf4
- test_integration:
requires:
- build_demo_app
- test_a11y_pf4:
requires:
- build_docs_pf4
- deploy_prerelease:
requires:
- lint_pf4
- test_jest_pf4
- test_integration
- build_docs_pf4
filters:
branches:
only: master
jobs:
build_pf4:
docker:
- image: circleci/node:12
steps:
- checkout
- persist_to_workspace:
root: ~/project
paths:
- "*"
- restore_cache:
keys:
- *js_deps_cache_key
- run:
name: Conditional install
command: if [ ! -d node_modules ]; then yarn install --frozen-lockfile; fi
- save_cache:
paths: *js_deps_paths
key: *js_deps_cache_key
- save_cache:
paths:
- ~/.cache/Cypress
key: *cypress_cache_key
- restore_cache:
keys:
- *build_cache_key
- run:
name: Build Dist
command: yarn build && yarn build:umd
- save_cache:
paths: *build_cache_paths
key: *build_cache_key
- persist_to_workspace:
root: ~/project
paths: *build_cache_paths
test_jest_pf4:
docker:
- image: circleci/node:12
steps:
- *attach_workspace
- restore_cache:
keys:
- *js_deps_cache_key
- run:
name: PF4 Jest Tests
command: yarn test --maxWorkers=2
- run:
name: Upload results to codecov
command: yarn run codecov -F patternfly4
when: always
build_demo_app:
docker:
- image: circleci/node:12
steps:
- *attach_workspace
- restore_cache:
keys:
- *js_deps_cache_key
- run:
name: Build React demo-app
command: yarn build:integration
- persist_to_workspace:
root: ~/project
paths:
- packages/react-integration/demo-app-ts/public/
test_integration:
docker:
- image: circleci/node:12
parallelism: 3
steps:
- *attach_workspace
- restore_cache:
keys:
- *js_deps_cache_key
- restore_cache:
keys:
- *cypress_cache_key
- run:
name: Install Cypress deps
command: sudo apt-get install libnss3 libgtk-3-0 libxss1 libasound2
- run:
name: Serve React demo-app
command: yarn serve:integration
background: true
- run:
name: Sleep to wait for xvfb
command: sleep 5
- run:
name: Run Cypress Integration Tests
command: |
cd packages/react-integration &&
yarn test:integration -s $(circleci tests glob "cypress/integration/*.spec.ts" | circleci tests split --split-by=timings)
- store_artifacts:
path: packages/react-integration/results
lint_pf4:
docker:
- image: circleci/node:12
steps:
- *attach_workspace
- restore_cache:
keys:
- *js_deps_cache_key
- restore_cache:
keys:
- *lint_cache_key
- run:
name: ESLint
command: yarn lint:ts
- run:
name: MDLint
command: yarn lint:md
- save_cache:
paths: *lint_cache_paths
key: *lint_cache_key
- run:
name: "@patternfly/patternfly Versions Match"
command: yarn lint:versions
when: always
- run:
name: Breaking Change Lint
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
command: |
if git log origin/master..HEAD --format="%b" | grep -i "breaking change";
then
echo "Breaking change above detected"
exit 1
fi
when: always
build_docs_pf4:
docker:
- image: circleci/node:12
steps:
- *attach_workspace
- restore_cache:
keys:
- *js_deps_cache_key
- restore_cache:
keys:
- *webpack_cache_key
- run:
name: Build patternfly-react docs
command: yarn build:docs
- save_cache:
paths: *webpack_cache_paths
key: *webpack_cache_key
- run:
name: Upload docs to surge.sh
command: node .circleci/upload-preview.js packages/react-docs/public
- persist_to_workspace:
root: ~/project
paths:
- packages/react-docs/public
- packages/react-docs/src/generated
test_a11y_pf4:
docker:
- image: circleci/node:12-browsers
steps:
- *attach_workspace
- restore_cache:
keys:
- *js_deps_cache_key
- run:
name: Serve docs
command: yarn serve:docs
background: true
- run:
name: PF4 a11y tests
command: yarn test:a11y
- run:
name: Upload a11y report
command: node .circleci/upload-preview.js packages/react-docs/coverage/dist
when: always
deploy_prerelease:
docker:
- image: circleci/node:12
steps:
- *attach_workspace
- restore_cache:
keys:
- *js_deps_cache_key
- run:
name: Avoid Unknown Host for github.com
command: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- run:
name: Deploy to NPM and Github
command: if [[ -z $CIRCLE_PULL_REQUEST ]]; then .circleci/release.sh; fi;