@@ -18,11 +18,13 @@ import groovy.transform.Field
18
18
// Step for running tests on a specific nodejs version with windows
19
19
def windowsStep (version ) {
20
20
node(label : ' windows' ) { ansiColor(' xterm' ) { withEnv([' CI=true' ]) {
21
+ def ciContext = ' continuous-integration/jenkins/windows/' + version
22
+ githubNotify description : ' Tests in progress' , status : ' PENDING' , context : ciContext
21
23
// need to make sure we're using the right line endings
22
24
bat ' git config --global core.autocrlf input'
23
25
checkout scm
24
26
fileExists ' package.json'
25
- nodejs(' 9.2.0 ' ) {
27
+ nodejs(version ) {
26
28
// delete node_modules if it's there
27
29
bat ' del /s /q node_modules >nul 2>&1'
28
30
// install local version of yarn (prevent concurrency issues again)
@@ -34,7 +36,9 @@ def windowsStep (version) {
34
36
// run actual tests
35
37
try {
36
38
bat yarnPath + ' test'
39
+ githubNotify description : ' Tests passed' , status : ' SUCCESS' , context : ciContext
37
40
} catch (err) {
41
+ githubNotify description : ' Tests failed' , status : ' FAILURE' , context : ciContext
38
42
throw err
39
43
} finally {
40
44
junit allowEmptyResults : true , testResults : ' junit-report-*.xml'
@@ -47,6 +51,8 @@ def windowsStep (version) {
47
51
// Step for running tests on a specific nodejs version with unix compatible OS
48
52
def unixStep (version , nodeLabel ) {
49
53
node(label : nodeLabel) { ansiColor(' xterm' ) { withEnv([' CI=true' ]) {
54
+ def ciContext = ' continuous-integration/jenkins/' + nodeLabel + ' /' + version
55
+ githubNotify description : ' Tests in progress' , status : ' PENDING' , context : ciContext
50
56
checkout scm
51
57
fileExists ' package.json'
52
58
nodejs(version) {
@@ -57,11 +63,14 @@ def unixStep(version, nodeLabel) {
57
63
if (nodeLabel == ' linux' ) { // if it's linux, we need xvfb for display emulation (chrome)
58
64
wrap([$class : ' Xvfb' , parallelBuild : true , autoDisplayName : true ]) {
59
65
sh yarnPath + ' test'
66
+ githubNotify description : ' Tests passed' , status : ' SUCCESS' , context : ciContext
60
67
}
61
68
} else {
62
69
sh yarnPath + ' test'
70
+ githubNotify description : ' Tests passed' , status : ' SUCCESS' , context : ciContext
63
71
}
64
72
} catch (err) {
73
+ githubNotify description : ' Tests failed' , status : ' FAILURE' , context : ciContext
65
74
throw err
66
75
} finally {
67
76
junit allowEmptyResults : true , testResults : ' junit-report-*.xml'
@@ -95,13 +104,21 @@ def call() {
95
104
}
96
105
}
97
106
steps[' linting' ] = {node(label : ' linux' ) { ansiColor(' xterm' ) { withEnv([' CI=true' ]) {
107
+ def ciContext = ' continuous-integration/jenkins/linting'
108
+ githubNotify description : ' Linting in progress' , status : ' PENDING' , context : ciContext
98
109
checkout scm
99
110
fileExists ' package.json'
100
111
nodejs(' 9.2.0' ) {
101
112
sh ' rm -rf node_modules/'
102
113
sh ' npm install yarn@' + yarnVersion
103
114
sh yarnPath + ' --mutex network'
104
- sh yarnPath + ' lint'
115
+ try {
116
+ sh yarnPath + ' lint'
117
+ githubNotify description : ' Linting passed' , status : ' SUCCESS' , context : ciContext
118
+ } catch (err) {
119
+ githubNotify description : ' Linting failed' , status : ' FAILURE' , context : ciContext
120
+ throw err
121
+ }
105
122
}
106
123
}}}}
107
124
// Maximum runtime: 1 hour
@@ -111,3 +128,4 @@ def call() {
111
128
}
112
129
}
113
130
}
131
+
0 commit comments