-
Notifications
You must be signed in to change notification settings - Fork 12
/
config.yml
144 lines (133 loc) · 3.29 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
---
version: 2
references:
filter_all: &filter_all
filters:
branches:
only: /.*/
tags:
only: /.*/
filter_stg: &filter_head
filters:
branches:
only: master
tags:
only: stg
filter_prd: &filter_release
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?/
jobs:
test_node10:
docker:
- image: circleci/node:10
working_directory: ~/src
steps:
- checkout
- restore_cache:
keys:
- v2-node10-dependencies-{{ checksum "package.json" }}
- v2-node10-dependencies-
- run: npm install
- save_cache:
key: v2-node10-dependencies-{{ checksum "package.json" }}
paths:
- node_modules
- run: npm test
test_node12:
docker:
- image: circleci/node:12
working_directory: ~/src
steps:
- checkout
- restore_cache:
keys:
- v2-node12-dependencies-{{ checksum "package.json" }}
- v2-node12-dependencies-
- run: npm install
- save_cache:
key: v2-node12-dependencies-{{ checksum "package.json" }}
paths:
- node_modules
- run: npm test
- run: cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
test_node14:
docker:
- image: circleci/node:14
working_directory: ~/src
steps:
- checkout
- restore_cache:
keys:
- v2-node14-dependencies-{{ checksum "package.json" }}
- v2-node14-dependencies-
- run: npm install
- save_cache:
key: v2-node14-dependencies-{{ checksum "package.json" }}
paths:
- node_modules
- run: npm test
deploy_docs:
docker:
- image: circleci/node:14
working_directory: ~/src
steps:
- checkout
- restore_cache:
key: v1-website-dependencies-{{ checksum "website/package.json" }}
- run:
name: Build
command: |
sudo apt-get -y install awscli
bash ./.circleci/scripts/deploy-docs.sh
- save_cache:
key: v1-website-dependencies-{{ checksum "website/package.json" }}
paths:
- website/node_modules
deploy_package:
docker:
- image: circleci/node:12
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v2-node12-dependencies-{{ checksum "package.json" }}
- v2-node12-dependencies-
- run: npm install
- run: |
echo "$NPMRC" > ~/.npmrc
chmod 600 ~/.npmrc
if [[ "$CIRCLE_TAG" = *-* ]]; then
npm publish --tag=prerelease
else
npm publish
fi
workflows:
version: 2
test:
jobs:
- test_node10:
<<: *filter_all
- test_node12:
<<: *filter_all
- test_node14:
<<: *filter_all
- deploy_docs:
<<: *filter_head
context:
- Documentation
requires:
- test_node10
- test_node12
- test_node14
- deploy_package:
<<: *filter_release
context:
- npm-publish
requires:
- test_node10
- test_node12
- test_node14