-
Notifications
You must be signed in to change notification settings - Fork 0
574 lines (573 loc) · 17.6 KB
/
ci.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
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# This file is automatically generated, do not edit manually!
# To regenerate it, run 'pnpm run build:workflow'
name: CI
on:
- push
- pull_request
env:
PRIMARY_NODE_VERSION: 18
jobs:
install:
name: Checkout and install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
build-docs:
name: Build docs
runs-on: ubuntu-latest
needs:
- install
- build-vality
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: ../docs
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Download Vality build artifact
uses: actions/download-artifact@v2
with:
name: build-vality
path: ./packages/vality
- name: Restore webpack cache
uses: actions/cache@v3
with:
path: docs/node_modules/.cache/webpack
key: docs-webpack-cache
restore-keys: docs-webpack-cache
- name: Build docs
run: pnpm --filter docs run build
- name: Cache webpack build
uses: actions/cache@v3
with:
path: docs/node_modules/.cache/webpack
key: docs-webpack-cache
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v1
with:
path: docs/build
deploy-docs:
name: Deploy docs
runs-on: ubuntu-latest
needs:
- build-docs
permissions:
pages: write
id-token: write
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
environment:
name: Docs
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: deploy-docs
cancel-in-progress: true
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v1
lint-eslint-plugin-vality:
name: "Lint: eslint-plugin-vality"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: eslint-plugin-vality
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Lint
run: pnpm --filter eslint-plugin-vality run lint
unit-test-eslint-plugin-vality:
name: "Unit Test: eslint-plugin-vality"
runs-on: ubuntu-latest
needs:
- install
strategy:
matrix:
node-version:
- 16
- 18
- 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: eslint-plugin-vality
node-version: ${{ matrix.node-version }}
- name: Test
if: ${{ matrix.node-version != env.PRIMARY_NODE_VERSION }}
run: pnpm --filter eslint-plugin-vality run test:unit
- name: Test (coverage)
if: ${{ matrix.node-version == env.PRIMARY_NODE_VERSION }}
run: pnpm --filter eslint-plugin-vality run test:coverage
- name: Upload coverage artifact
if: ${{ matrix.node-version == env.PRIMARY_NODE_VERSION }}
uses: actions/upload-artifact@v2
with:
name: coverage-eslint-plugin-vality
path: ./packages/eslint-plugin-vality/coverage
type-test-eslint-plugin-vality:
name: "Type Test: eslint-plugin-vality"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: eslint-plugin-vality
node-version: ${{ matrix.node-version }}
- name: Test
if: ${{ matrix.node-version != env.PRIMARY_NODE_VERSION }}
run: pnpm --filter eslint-plugin-vality run test:type
typecheck-eslint-plugin-vality:
name: "Typecheck: eslint-plugin-vality"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: eslint-plugin-vality
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Typecheck
run: pnpm --filter eslint-plugin-vality run typecheck
check-version-eslint-plugin-vality:
name: "Check version: eslint-plugin-vality"
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
outputs:
should-publish: ${{ steps.check.outputs.changed }}
current-version: ${{ steps.check.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for version changes
id: check
uses: EndBug/version-check@v2
with:
file-name: ./packages/eslint-plugin-vality/package.json
file-url: https://unpkg.com/eslint-plugin-vality/package.json
static-checking: localIsNew
build-eslint-plugin-vality:
name: "Build: eslint-plugin-vality"
runs-on: ubuntu-latest
needs:
- lint-eslint-plugin-vality
- unit-test-eslint-plugin-vality
- type-test-eslint-plugin-vality
- typecheck-eslint-plugin-vality
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: eslint-plugin-vality
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
run: pnpm --filter eslint-plugin-vality run build
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: build-eslint-plugin-vality
path: |-
./packages/eslint-plugin-vality/dist
./packages/eslint-plugin-vality/src
./packages/eslint-plugin-vality/package.json
./packages/eslint-plugin-vality/README.md
./packages/eslint-plugin-vality/LICENSE.json
coverage-eslint-plugin-vality:
name: "Upload coverage: eslint-plugin-vality"
runs-on: ubuntu-latest
needs:
- unit-test-eslint-plugin-vality
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download coverage artifact
uses: actions/download-artifact@v2
with:
name: coverage-eslint-plugin-vality
path: ./packages/eslint-plugin-vality/coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
files: ./packages/eslint-plugin-vality/coverage/lcov.info
flags: eslint-plugin-vality
publish-eslint-plugin-vality:
name: "Publish: eslint-plugin-vality"
runs-on: ubuntu-latest
needs:
- build-eslint-plugin-vality
- check-version-eslint-plugin-vality
if: ${{ needs.check-version-eslint-plugin-vality.outputs.should-publish ==
'true' }}
environment:
name: "npm: eslint-plugin-vality"
url: https://www.npmjs.com/package/eslint-plugin-vality
steps:
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: build-eslint-plugin-vality
path: ./packages/eslint-plugin-vality
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Publish to NPM
working-directory: ./packages/eslint-plugin-vality
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
lint-vality:
name: "Lint: vality"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Lint
run: pnpm --filter vality run lint
unit-test-vality:
name: "Unit Test: vality"
runs-on: ubuntu-latest
needs:
- install
strategy:
matrix:
node-version:
- 16
- 18
- 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality
node-version: ${{ matrix.node-version }}
- name: Test
if: ${{ matrix.node-version != env.PRIMARY_NODE_VERSION }}
run: pnpm --filter vality run test:unit
- name: Test (coverage)
if: ${{ matrix.node-version == env.PRIMARY_NODE_VERSION }}
run: pnpm --filter vality run test:coverage
- name: Upload coverage artifact
if: ${{ matrix.node-version == env.PRIMARY_NODE_VERSION }}
uses: actions/upload-artifact@v2
with:
name: coverage-vality
path: ./packages/vality/coverage
type-test-vality:
name: "Type Test: vality"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality
node-version: ${{ matrix.node-version }}
- name: Test
if: ${{ matrix.node-version != env.PRIMARY_NODE_VERSION }}
run: pnpm --filter vality run test:type
typecheck-vality:
name: "Typecheck: vality"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Typecheck
run: pnpm --filter vality run typecheck
check-version-vality:
name: "Check version: vality"
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
outputs:
should-publish: ${{ steps.check.outputs.changed }}
current-version: ${{ steps.check.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for version changes
id: check
uses: EndBug/version-check@v2
with:
file-name: ./packages/vality/package.json
file-url: https://unpkg.com/vality/package.json
static-checking: localIsNew
build-vality:
name: "Build: vality"
runs-on: ubuntu-latest
needs:
- lint-vality
- unit-test-vality
- type-test-vality
- typecheck-vality
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
run: pnpm --filter vality run build
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: build-vality
path: |-
./packages/vality/dist
./packages/vality/src
./packages/vality/package.json
./packages/vality/README.md
./packages/vality/LICENSE.json
coverage-vality:
name: "Upload coverage: vality"
runs-on: ubuntu-latest
needs:
- unit-test-vality
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download coverage artifact
uses: actions/download-artifact@v2
with:
name: coverage-vality
path: ./packages/vality/coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
files: ./packages/vality/coverage/lcov.info
flags: vality
publish-vality:
name: "Publish: vality"
runs-on: ubuntu-latest
needs:
- build-vality
- check-version-vality
if: ${{ needs.check-version-vality.outputs.should-publish == 'true' }}
environment:
name: "npm: vality"
url: https://www.npmjs.com/package/vality
steps:
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: build-vality
path: ./packages/vality
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Publish to NPM
working-directory: ./packages/vality
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
lint-vality-env:
name: "Lint: vality-env"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality-env
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Lint
run: pnpm --filter vality-env run lint
unit-test-vality-env:
name: "Unit Test: vality-env"
runs-on: ubuntu-latest
needs:
- install
strategy:
matrix:
node-version:
- 16
- 18
- 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality-env
node-version: ${{ matrix.node-version }}
- name: Test
if: ${{ matrix.node-version != env.PRIMARY_NODE_VERSION }}
run: pnpm --filter vality-env run test:unit
- name: Test (coverage)
if: ${{ matrix.node-version == env.PRIMARY_NODE_VERSION }}
run: pnpm --filter vality-env run test:coverage
- name: Upload coverage artifact
if: ${{ matrix.node-version == env.PRIMARY_NODE_VERSION }}
uses: actions/upload-artifact@v2
with:
name: coverage-vality-env
path: ./packages/vality-env/coverage
type-test-vality-env:
name: "Type Test: vality-env"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality-env
node-version: ${{ matrix.node-version }}
- name: Test
if: ${{ matrix.node-version != env.PRIMARY_NODE_VERSION }}
run: pnpm --filter vality-env run test:type
typecheck-vality-env:
name: "Typecheck: vality-env"
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality-env
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Typecheck
run: pnpm --filter vality-env run typecheck
check-version-vality-env:
name: "Check version: vality-env"
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
outputs:
should-publish: ${{ steps.check.outputs.changed }}
current-version: ${{ steps.check.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for version changes
id: check
uses: EndBug/version-check@v2
with:
file-name: ./packages/vality-env/package.json
file-url: https://unpkg.com/vality-env/package.json
static-checking: localIsNew
build-vality-env:
name: "Build: vality-env"
runs-on: ubuntu-latest
needs:
- lint-vality-env
- unit-test-vality-env
- type-test-vality-env
- typecheck-vality-env
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
package: vality-env
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
run: pnpm --filter vality-env run build
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: build-vality-env
path: |-
./packages/vality-env/dist
./packages/vality-env/src
./packages/vality-env/package.json
./packages/vality-env/README.md
./packages/vality-env/LICENSE.json
coverage-vality-env:
name: "Upload coverage: vality-env"
runs-on: ubuntu-latest
needs:
- unit-test-vality-env
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download coverage artifact
uses: actions/download-artifact@v2
with:
name: coverage-vality-env
path: ./packages/vality-env/coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
files: ./packages/vality-env/coverage/lcov.info
flags: vality-env
publish-vality-env:
name: "Publish: vality-env"
runs-on: ubuntu-latest
needs:
- build-vality-env
- check-version-vality-env
if: ${{ needs.check-version-vality-env.outputs.should-publish == 'true' }}
environment:
name: "npm: vality-env"
url: https://www.npmjs.com/package/vality-env
steps:
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: build-vality-env
path: ./packages/vality-env
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Publish to NPM
working-directory: ./packages/vality-env
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}