Updating Jenkinsfile and test/Makefile to support junit test reports.

This commit is contained in:
mdlewisfb
2018-10-18 12:47:47 -07:00
parent e187562cea
commit bfb75c4d07
2 changed files with 24 additions and 13 deletions

View File

@@ -8,7 +8,6 @@ git diff > clang_format.patch
# Delete if 0 size and exit with 0
if [ ! -s clang_format.patch ]
then
rm clang_format.patch
exit 0
fi

View File

@@ -1,28 +1,40 @@
node {
currentBuild.result = 'SUCCESS'
withEnv(["UNITY_ROOT=$HOME/Unity", "TOOLCHAIN=$HOME/gcc-arm-none-eabi"]) {
try {
stage('Checkout') {
step([$class: 'WsCleanup'])
echo 'Checking out SCM'
checkout scm
}
withEnv(["UNITY_ROOT=$HOME/Unity", "TOOLCHAIN=$HOME/gcc-arm-none-eabi", "OCWARE_DIR=./"]) {
stage('Checkout') {
step([$class: 'WsCleanup'])
echo 'Checking out SCM'
checkout scm
}
try {
stage('Static Analysis') {
sh 'bash .ci/clang_patch'
dir ('firmware/ec') { sh 'bash ../../.ci/clang_patch' }
}
} catch (err) {
currentBuild.result = 'ERROR'
} finally {
archiveArtifacts '**/clang_format.patch'
}
try {
stage('Unit Test') {
dir ("firmware/ec/test"){ sh 'make ci' }
}
} catch (err) {
currentBuild.result = 'FAILURE'
} finally {
junit 'firmware/ec/test/build/results/unit-test-results.xml'
}
try {
stage('Firmware Build') {
dir ('firmware/ec') { sh 'make all' }
dir ('firmware/ec') { sh 'make clean all' }
}
} catch (err) {
currentBuild.result = 'FAILURE'
throw err
}
} finally {
warnings consoleParsers: [[parserName: 'GNU Make + GNU C Compiler (gcc)']]
}
}
}