-
Notifications
You must be signed in to change notification settings - Fork 532
/
config.yml
295 lines (285 loc) · 7.69 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
version: 2.1
orbs:
win: circleci/windows@2.2.0
defaults: &defaults
parameters:
node_version:
type: string
default: ''
working_directory: ~/snyk
windows_defaults: &windows_defaults
environment:
npm_config_loglevel: silent
executor:
name: win/default
commands:
install_deps:
description: Install dependencies
steps:
- run:
name: Use snyk-main npmjs user
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
- run:
name: Install dependencies
command: npm install
build_ts:
description: Build js files from ts
steps:
- run:
name: Build
command: npm run build
- persist_to_workspace:
root: .
paths:
- dist/
install_maven_windows:
description: Install maven
steps:
- run: choco install maven
install_sbt_windows:
description: Install SBT
steps:
- run: choco install sbt
install_maven_unix:
description: Install maven
steps:
- run: sudo apt update
- run: sudo apt install -y maven
install_sbt_unix:
description: Install SBT
steps:
- run: sudo apt install apt-transport-https ca-certificates
- run: echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
- run: curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
- run: sudo apt update
- run: sudo apt install -y sbt
install_node_npm:
description: Install correct Node version
parameters:
node_version:
type: string
default: ''
steps:
- run:
name: Install correct version of Node
command: nvm install << parameters.node_version >>
- run:
name: Use correct version of Node
command: nvm use << parameters.node_version >>
install_shellspec:
description: Install Shellspec
steps:
- run: curl -fsSL https://git.io/shellspec | sh -s -- -y
- run: sudo ln -s ${HOME}/.local/lib/shellspec/shellspec /usr/local/bin/shellspec
- run: sudo apt-get install jq
show_node_version:
description: Log Node and npm version
steps:
- run:
name: Node version
command: node --version
- run:
name: NPM version
command: npm --version
jobs:
regression-test:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
steps:
- checkout
- install_shellspec
- install_deps
- build_ts
- run:
name: Run auth
command: npm run snyk-auth
- run:
name: Run tests
command: npm run test:common
- run:
name: Clear Snyk config
command: rm ~/.config/configstore/snyk.json
- run:
name: Clear node_modules
command: rm -rf node_modules/
- run:
name: Install only production dependencies
command: npm install
environment:
NODE_ENV: production
- run:
name: npm install for fixture project
working_directory: ~/snyk/test/fixtures/basic-npm
command: npm install
- run:
name: Setup alias for snyk
working_directory: ~/snyk/
command: sudo ./test/smoke/setup-alias-for-snyk.sh
- run:
name: Run shellspec
working_directory: ~/snyk/test/smoke
command: |
echo "Checkout the README in test/smoke folder for more details about this step"
unset SNYK_API
unset SNYK_API_KEY
shellspec -f d
test-windows:
<<: *defaults
<<: *windows_defaults
steps:
- run: git config --global core.autocrlf false
- install_maven_windows
- install_sbt_windows
- install_node_npm:
node_version: << parameters.node_version >>
- show_node_version
- checkout
- attach_workspace:
at: ~/snyk
- install_deps
- build_ts
- run:
name: npm version
command: npm --version
- run:
name: Run auth
command: npm run snyk-auth-windows
- run:
name: Run tests
command: npm run test-windows
test-unix:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
steps:
- install_maven_unix
- install_sbt_unix
- show_node_version
- checkout
- attach_workspace:
at: ~/snyk
- install_deps
- build_ts
- run:
name: npm version
command: npm --version
- run:
name: Run auth
command: npm run snyk-auth
- run:
name: Run tests
command: npm test
release:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
resource_class: small
steps:
- checkout
- install_deps
- run: sudo npm i -g semantic-release @semantic-release/exec pkg
- run: sudo apt-get install -y osslsigncode
- run:
name: Publish to GitHub
command: semantic-release
workflows:
version: 2
test_and_release:
jobs:
- regression-test:
name: Regression Test
context: nodejs-install
node_version: '8'
filters:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v12 support
context: nodejs-install
node_version: '12.0.0'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v14 support
context: nodejs-install
node_version: '14'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v10 support
context: nodejs-install
node_version: '10.21.0'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v8 support
context: nodejs-install
node_version: '8.17.0'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v12 support
context: nodejs-install
node_version: '12.16.2'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v14 support
context: nodejs-install
node_version: '14'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v10 support
context: nodejs-install
node_version: '10'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v8 support
context: nodejs-install
node_version: '8'
requires:
- Regression Test
filters:
branches:
ignore:
- master
- release:
name: Release
context: nodejs-app-release
node_version: '14'
filters:
branches:
only:
- master