Pipeline improvements (#964)

* Fix bug with toll-gate validation against master
* Change cppcheck to not attempt to validate headers directly and
  to run on the entire codebase in the pipeline.
* Support running Arduino test and examples build in parallel
This commit is contained in:
Patrick Fallberg
2017-10-29 21:48:39 +01:00
committed by tekka
parent e6cef8ba63
commit 9b630f7d46
5 changed files with 24 additions and 10 deletions
+13 -7
View File
@@ -2,16 +2,22 @@
def call(config) {
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Gitler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
if (env.CHANGE_TARGET == 'master' &&
(env.CHANGE_AUTHOR != 'bblacey' || env.CHANGE_AUTHOR != 'd00616' ||
env.CHANGE_AUTHOR != 'fallberg' || env.CHANGE_AUTHOR != 'henrikekblad' ||
env.CHANGE_AUTHOR != 'marceloaqno' || env.CHANGE_AUTHOR != 'mfalkvidd' ||
env.CHANGE_AUTHOR != 'scalz' || env.CHANGE_AUTHOR != 'tbowmo' ||
env.CHANGE_AUTHOR != 'tekka007' || env.CHANGE_AUTHOR != 'user2684' ||
(env.CHANGE_AUTHOR != 'bblacey' && env.CHANGE_AUTHOR != 'd00616' &&
env.CHANGE_AUTHOR != 'fallberg' && env.CHANGE_AUTHOR != 'henrikekblad' &&
env.CHANGE_AUTHOR != 'marceloaqno' && env.CHANGE_AUTHOR != 'mfalkvidd' &&
env.CHANGE_AUTHOR != 'scalz' && env.CHANGE_AUTHOR != 'tbowmo' &&
env.CHANGE_AUTHOR != 'tekka007' && env.CHANGE_AUTHOR != 'user2684' &&
env.CHANGE_AUTHOR != 'Yveaux'))
{
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'This pull request targets master. That is not permitted!', '')
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'This pull request targets master. That is not permitted for '+env.CHANGE_AUTHOR, '')
error "This pull request targets master. That is not permitted!"
}
else if (env.CHANGE_TARGET == 'master')
{
echo env.CHANGE_AUTHOR + ' is a valid author for targeting master branch, skipping further validation'
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Gitler)', 'Pass', '')
return
}
dir(config.repository_root) {
step([$class: 'GitChangelogRecorder', config: [configFile: 'git-changelog-settings.json',
@@ -102,4 +108,4 @@ def call(config) {
}
}
return this
return this
+3
View File
@@ -121,6 +121,9 @@ def call(Closure body) {
stage('ArduinoMega (tests)') {
arduino.buildArduinoMega(config, config.tests, 'Tests')
}
}
}, ArduinoExampleBuilds: {
lock(quantity: 1, resource: 'arduinoExampleEnv') {
stage('MySensorsMicro (examples)') {
arduino.buildMySensorsMicro(config, config.examples, 'Examples')
}
+1 -1
View File
@@ -5,7 +5,7 @@ def cppCheck(config) {
sh """#!/bin/bash +x
cd ${config.repository_root}
echo "Doing cppcheck for AVR..."
git diff --name-only origin/${env.CHANGE_TARGET}..${config.git_sha} | sed '/.ci\\/gitler.sh/d' | sed '/README.md/d' | cppcheck -j 4 --file-list=- --enable=style,information --platform=.mystools/cppcheck/config/avr.xml --suppressions-list=.mystools/cppcheck/config/suppressions.cfg --includes-file=.mystools/cppcheck/config/includes.cfg --language=c++ --xml --xml-version=2 2> cppcheck-avr.xml
find . -type f \\( -iname \\*.c -o -iname \\*.cpp -o -iname \\*.ino \\) | cppcheck -j 4 --file-list=- --enable=style,information --platform=.mystools/cppcheck/config/avr.xml --suppressions-list=.mystools/cppcheck/config/suppressions.cfg --includes-file=.mystools/cppcheck/config/includes.cfg --language=c++ --xml --xml-version=2 2> cppcheck-avr.xml
cppcheck-htmlreport --file="cppcheck-avr.xml" --title="cppcheck-avr" --report-dir=cppcheck-avr_cppcheck_reports --source-dir=."""
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true,
+1
View File
@@ -5,6 +5,7 @@ OPTIONS="--quiet \
--force \
--enable=style,information \
-DCPPCHECK \
--language=c++ \
--library=${LIBRARY:-avr} \
--platform="${TOOLCONFIG}"/${PLATFORM:-avr.xml} \
--includes-file="${TOOLCONFIG}"/includes.cfg \
+6 -2
View File
@@ -7,11 +7,15 @@
# --cached or <no arg> for changed
if [[ $# = 0 ]]; then
for file in $(modifiedSourceFiles); do
runBundle $file
if [[ $file != *.h ]]; then
runBundle $file
fi
done
elif [[ $1 = '--cached' ]]; then
for file in $(stagedSourceFiles); do
runBundle $file
if [[ $file != *.h ]]; then
runBundle $file
fi
done
else
eval "set -- $(git rev-parse --sq --prefix "$GIT_PREFIX" "$@")"