UNPKG

1.99 kBYAMLView Raw
1version: 2.1
2
3executors:
4 node:
5 docker:
6 - image: circleci/node:12.7
7 working_directory: ~/repo
8 environment:
9 GIT_AUTHOR_EMAIL: visjsbot@gmail.com
10 GIT_AUTHOR_NAME: vis-bot
11 GIT_COMMITTER_EMAIL: visjsbot@gmail.com
12 GIT_COMMITTER_NAME: vis-bot
13
14jobs:
15 prepare:
16 executor: node
17
18 steps:
19 - checkout
20
21 # Download and cache dependencies
22 - restore_cache:
23 keys:
24 - v1-dependencies-{{ checksum "package.json" }}
25 # fallback to using the latest cache if no exact match is found
26 - v1-dependencies-
27
28 - run: npm ci
29
30 - save_cache:
31 paths:
32 - node_modules
33 key: v1-dependencies-{{ checksum "package.json" }}
34
35 - persist_to_workspace:
36 root: .
37 paths:
38 - '*'
39
40 build:
41 executor: node
42
43 steps:
44 - attach_workspace:
45 at: .
46
47 - run: npm run build
48
49 - persist_to_workspace:
50 root: .
51 paths:
52 - 'dist'
53
54 lint:
55 executor: node
56
57 steps:
58 - attach_workspace:
59 at: .
60
61 - run: npm run lint
62
63 test:
64 executor: node
65
66 steps:
67 - attach_workspace:
68 at: .
69
70 - run: npm run test-cov
71
72 release:
73 executor: node
74
75 steps:
76 - attach_workspace:
77 at: .
78
79 - run:
80 name: Prepare NPM
81 command: |
82 npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
83
84 - run:
85 name: Release
86 command: |
87 npx semantic-release
88
89workflows:
90 version: 2
91
92 build:
93 jobs:
94 - prepare
95
96 - build:
97 requires:
98 - prepare
99
100 - lint:
101 requires:
102 - prepare
103
104 - test:
105 requires:
106 - prepare
107
108 - release:
109 requires:
110 - prepare
111 - build
112 - lint
113 - test
114 filters:
115 branches:
116 only:
117 - master