-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
98 lines (90 loc) · 2.25 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
version: 2.1
executors:
node-lts:
docker:
- image: circleci/node:lts
#
# Jobs - https://circleci.com/docs/2.0/configuration-reference/#jobs
#
# Groups of comands used in one or more Workflows
#
# - Keep GLOBAL variable usage at a minimum
# - Prioritize `parameters` usage
#
jobs:
setup:
executor: node-lts
working_directory: ~/tpl-node
steps:
- checkout
- run:
name: "[npm] Install packages"
command: "npm run setup"
- save_cache:
paths: [ node_modules ]
key: tpl-node-{{ checksum "package-lock.json" }}
test:
executor: node-lts
working_directory: ~/tpl-node
steps:
- checkout
- restore_cache:
key: tpl-node-{{ checksum "package-lock.json" }}
- run:
name: "[eslint,markdownlint]: Lint"
command: "npm run lint"
- run:
name: "[tsc]: Typecheck"
command: "npm run typecheck"
- run:
name: "[tape]: Test"
command: "npm run test"
coverage:
executor: node-lts
working_directory: ~/tpl-node
steps:
- checkout
- restore_cache:
key: tpl-node-{{ checksum "package-lock.json" }}
- run:
name: "[c8,coveralls]: Coveralls"
command: "npm run coverage"
publish:
executor: node-lts
working_directory: ~/tpl-node
steps:
- checkout
- restore_cache:
key: tpl-node-{{ checksum "package-lock.json" }}
- run:
name: "[semantic-release]: Publish package to npm"
command: "npm run publish"
#
# Workflows - https://circleci.com/docs/2.0/workflows/
#
# - Treat workflows as piping commands (cmd1 -p1 lorem | cmd2 | ... | cmdN) or
# function composition
# - Use/set GLOBAL variables if they are used in more than 2 jobs
#
workflows:
npm_publish:
jobs:
- setup:
filters:
branches:
only: [ master ]
- test:
filters:
branches:
only: [ master ]
requires: [ setup ]
- coverage:
filters:
branches:
only: [ master ]
requires: [ test ]
- publish:
filters:
branches:
only: [ master ]
requires: [ coverage ]