File tree Expand file tree Collapse file tree 1 file changed +78
-0
lines changed Expand file tree Collapse file tree 1 file changed +78
-0
lines changed Original file line number Diff line number Diff line change
1
+ version : 2.1
2
+
3
+ executors :
4
+ node :
5
+ parameters :
6
+ tag :
7
+ type : string
8
+ docker :
9
+ - image : cimg/node:<< parameters.tag >>
10
+
11
+ commands :
12
+ install-dependencies :
13
+ steps :
14
+ - run :
15
+ name : " Install project dependencies"
16
+ command : npm i
17
+ install-prerequisites :
18
+ steps :
19
+ - run :
20
+ name : " APT update"
21
+ command : sudo apt-get update
22
+ - run :
23
+ name : " Fetch and install libsecret"
24
+ command : sudo apt-get install -y libsecret-1-dev
25
+ run-unit-tests :
26
+ steps :
27
+ - run :
28
+ name : " Run unit tests"
29
+ command : npm run test:ci
30
+ run-linter :
31
+ steps :
32
+ - run :
33
+ name : " Run linter"
34
+ command : npm run lint
35
+
36
+ jobs :
37
+ pr-validator :
38
+ resource_class : xlarge
39
+ environment :
40
+ NODE_OPTIONS : --max-old-space-size=14336
41
+ CI : " "
42
+ parameters :
43
+ node-version :
44
+ type : string
45
+ executor :
46
+ name : node
47
+ tag : << parameters.node-version >>
48
+ steps :
49
+ - checkout
50
+ - apt-update
51
+ - install-prerequisites
52
+ - install-dependencies
53
+ - run-linter
54
+ - run-unit-tests
55
+ - when :
56
+ condition :
57
+ equal : [<< parameters.node-version >>, lts]
58
+ steps :
59
+ - run :
60
+ name : " CODECOV"
61
+ command : npm run coverage -- --token=$CODECOV_TOKEN
62
+
63
+ workflows :
64
+ validate :
65
+ jobs :
66
+ - pr-validator :
67
+ matrix :
68
+ parameters :
69
+ node-version : ["10.24", "12.21", "14.16", lts]
70
+ filters :
71
+ branches :
72
+ only : /^(main|v[1-9]?[0-9]-beta)$/
73
+ post-steps :
74
+ - run :
75
+ name : Send Slack notification
76
+ command : |
77
+ curl -X POST -H "Content-type:application/json" --data "{'text':':error: $CIRCLE_PROJECT_REPONAME/$CIRCLE_BRANCH - $CIRCLE_PULL_REQUEST validation failed on *Node:${CIRCLE_JOB/pr-validator-/''}*. View <$CIRCLE_BUILD_URL|build>. cc: <@$CIRCLE_USERNAME>', 'mrkdwn':true}" $SLACK_WEBHOOK
78
+ when : on_fail
You can’t perform that action at this time.
0 commit comments