From cd5c9564fd09138085ecf4a0ac4afdb53255f362 Mon Sep 17 00:00:00 2001 From: Mika Karjalainen Date: Mon, 13 Jun 2016 10:57:52 +0300 Subject: [PATCH] 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. --- Jenkinsfile | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 705b457746..9bfdda570a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,6 +9,7 @@ def morpheusTargets = [ // Map morpheus toolchains to compiler labels on Jenkins def toolchains = [ //ARM: "armcc", + //IAR: "iar_arm", GCC_ARM: "arm-none-eabi-gcc" ] @@ -27,17 +28,22 @@ for (int i = 0; i < morpheusTargets.size(); i++) { } } -/* Jenkins does not allow stages inside parallel execution, - * https://issues.jenkins-ci.org/browse/JENKINS-26107 will solve this by adding labeled blocks - */ -stage "parallel build" try { + /* Jenkins does not allow stages inside parallel execution, + * https://issues.jenkins-ci.org/browse/JENKINS-26107 will solve this by adding labeled blocks + */ + stage "parallel build" // Actually run the steps in parallel - parallel takes a map as an argument, hence the above. parallel stepsForParallel - + + stage "build testapps" + parallel testapp: { + build 'ARMmbed/mbed-client-testapp/master' + }, cliapp: { + build 'ARMmbed/mbed-client-cliapp/master' + }, failFast: true } catch (err) { currentBuild.result = 'FAILURE' - } //Create yotta build steps for parallel execution @@ -47,8 +53,14 @@ try { deleteDir() dir("mbed-os") { checkout scm - sh "mbed deploy --protocol ssh" - sh "mbed compile --tests -m ${target} -t ${toolchain} -c" + // shell script on Unix, batch on Windows + if (isUnix()) { + sh "mbed deploy --protocol ssh" + sh "mbed compile --tests -m ${target} -t ${toolchain} -c" + } else { + bat "mbed deploy --protocol ssh" + bat "mbed compile --tests -m ${target} -t ${toolchain} -c" + } } } }