Skip to content

Commit cd5c956

Browse files
authored
Add test application builds to Jenkinsfile (#266)
Added test application job calls as postbuild step. Added support for IAR toolchain but not enabling this yet. Changed environmet check from compiler label to isUnix call.
1 parent 219f6e2 commit cd5c956

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

Jenkinsfile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def morpheusTargets = [
99
// Map morpheus toolchains to compiler labels on Jenkins
1010
def toolchains = [
1111
//ARM: "armcc",
12+
//IAR: "iar_arm",
1213
GCC_ARM: "arm-none-eabi-gcc"
1314
]
1415

@@ -27,17 +28,22 @@ for (int i = 0; i < morpheusTargets.size(); i++) {
2728
}
2829
}
2930

30-
/* Jenkins does not allow stages inside parallel execution,
31-
* https://issues.jenkins-ci.org/browse/JENKINS-26107 will solve this by adding labeled blocks
32-
*/
33-
stage "parallel build"
3431
try {
32+
/* Jenkins does not allow stages inside parallel execution,
33+
* https://issues.jenkins-ci.org/browse/JENKINS-26107 will solve this by adding labeled blocks
34+
*/
35+
stage "parallel build"
3536
// Actually run the steps in parallel - parallel takes a map as an argument, hence the above.
3637
parallel stepsForParallel
37-
38+
39+
stage "build testapps"
40+
parallel testapp: {
41+
build 'ARMmbed/mbed-client-testapp/master'
42+
}, cliapp: {
43+
build 'ARMmbed/mbed-client-cliapp/master'
44+
}, failFast: true
3845
} catch (err) {
3946
currentBuild.result = 'FAILURE'
40-
4147
}
4248

4349
//Create yotta build steps for parallel execution
@@ -47,8 +53,14 @@ try {
4753
deleteDir()
4854
dir("mbed-os") {
4955
checkout scm
50-
sh "mbed deploy --protocol ssh"
51-
sh "mbed compile --tests -m ${target} -t ${toolchain} -c"
56+
// shell script on Unix, batch on Windows
57+
if (isUnix()) {
58+
sh "mbed deploy --protocol ssh"
59+
sh "mbed compile --tests -m ${target} -t ${toolchain} -c"
60+
} else {
61+
bat "mbed deploy --protocol ssh"
62+
bat "mbed compile --tests -m ${target} -t ${toolchain} -c"
63+
}
5264
}
5365
}
5466
}

0 commit comments

Comments
 (0)