/
config.yml
75 lines (72 loc) · 1.75 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
aliases:
restore_cache_step: &restore_cache_step
restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
save_cache_step: &save_cache_step
save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
install_dependencies_step: &install_dependencies_step
run:
name: install-dependencies
command: yarn install
unit_test: &unit_test
steps:
- checkout
- *restore_cache_step
- *install_dependencies_step
- *save_cache_step
- run:
name: tests
# Why `--maxWorkers`? https://vgpena.github.io/jest-circleci/
command: 'yarn jest --ci --maxWorkers=2'
- run:
name: lint
command: 'yarn lint'
version: 2
jobs:
node-v10-latest:
docker:
- image: circleci/node:10
<<: *unit_test
node-v11-latest:
docker:
- image: circleci/node:11
<<: *unit_test
node-v12-latest:
docker:
- image: circleci/node:12
<<: *unit_test
node-v13-latest:
docker:
- image: circleci/node:13
<<: *unit_test
deploy:
docker:
- image: circleci/node:latest
steps:
- checkout
- *restore_cache_step
- *install_dependencies_step
- *save_cache_step
- run:
name: Publish package
command: 'yarn install && yarn build && npx semantic-release && yarn update-website'
workflows:
version: 2
test-deploy:
jobs:
- node-v10-latest
- node-v11-latest
- node-v12-latest
- node-v13-latest
- deploy:
requires:
- node-v10-latest
- node-v11-latest
- node-v12-latest
- node-v13-latest
filters:
branches:
only: master