diff --git a/.ci/clang_patch b/.ci/clang_patch index 991a1ba721..97c87d645a 100755 --- a/.ci/clang_patch +++ b/.ci/clang_patch @@ -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 diff --git a/firmware/ec/Jenkinsfile b/firmware/ec/Jenkinsfile index eaf7d87cc9..7ee6060222 100644 --- a/firmware/ec/Jenkinsfile +++ b/firmware/ec/Jenkinsfile @@ -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)']] + } } }