-
-
Notifications
You must be signed in to change notification settings - Fork 108
/
config.yml
167 lines (141 loc) · 3.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
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
version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.4.8
codecov: codecov/codecov@4.1.0
executors:
node:
parameters:
browser:
type: boolean
default: false
version:
type: string
default: '20.17.0' # Specify LTS major and minor for development
docker:
- image: cimg/node:<< parameters.version >><<# parameters.browser >>-browsers<</ parameters.browser >>
working_directory: ~/marp-cli
commands:
install:
parameters:
postinstall:
type: steps
default: []
steps:
- restore_cache:
keys:
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-{{ .Branch }}
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-
- run: |
npm ci
npx patch-package
- steps: << parameters.postinstall >>
- save_cache:
key: v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-{{ .Branch }}
paths:
- ~/.npm
audit:
steps:
- checkout
- install:
postinstall:
- run: npm -s run check:audit
prepare:
parameters:
browser:
type: boolean
default: false
steps:
- run: node --version
- checkout
- install
- when:
condition: << parameters.browser >>
steps:
- browser-tools/install-chrome
- browser-tools/install-firefox
lint:
steps:
- run:
name: Prettier formatting
command: npm run check:format
- run:
name: TypeScript type checking
command: npm run check:ts
- run:
name: ESLint
command: npm run lint:js
- run:
name: stylelint
command: npm run lint:css
test:
steps:
- run:
name: Jest
command: npm run test:coverage -- --ci -i --reporters=default --reporters=jest-junit
environment:
JEST_JUNIT_OUTPUT_DIR: tmp/test-results
MARP_TEST_CI: 1
- codecov/upload:
flags: linux
- store_test_results:
path: tmp/test-results
- store_artifacts:
path: ./coverage
destination: coverage
build:
steps:
- checkout
- install
- run: npm run build
- persist_to_workspace:
root: ~/marp-cli
paths:
- lib
jobs:
audit:
executor: node
steps:
- audit
test-node18:
executor:
name: node
browser: true
version: '18.20'
steps:
- prepare:
browser: true
- lint
- test
test-node20:
executor:
name: node
browser: true
steps:
- prepare:
browser: true
- lint
- test
test-node22:
executor:
name: node
browser: true
version: '22.8'
steps:
- prepare:
browser: true
- lint
- test
workflows:
test:
jobs:
- audit
- test-node18:
requires:
- audit
- test-node20:
requires:
- audit
- test-node22:
requires:
- audit