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:
+12
-6
@@ -2,16 +2,22 @@
|
|||||||
def call(config) {
|
def call(config) {
|
||||||
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Gitler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
|
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Gitler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
|
||||||
if (env.CHANGE_TARGET == 'master' &&
|
if (env.CHANGE_TARGET == 'master' &&
|
||||||
(env.CHANGE_AUTHOR != 'bblacey' || env.CHANGE_AUTHOR != 'd00616' ||
|
(env.CHANGE_AUTHOR != 'bblacey' && env.CHANGE_AUTHOR != 'd00616' &&
|
||||||
env.CHANGE_AUTHOR != 'fallberg' || env.CHANGE_AUTHOR != 'henrikekblad' ||
|
env.CHANGE_AUTHOR != 'fallberg' && env.CHANGE_AUTHOR != 'henrikekblad' &&
|
||||||
env.CHANGE_AUTHOR != 'marceloaqno' || env.CHANGE_AUTHOR != 'mfalkvidd' ||
|
env.CHANGE_AUTHOR != 'marceloaqno' && env.CHANGE_AUTHOR != 'mfalkvidd' &&
|
||||||
env.CHANGE_AUTHOR != 'scalz' || env.CHANGE_AUTHOR != 'tbowmo' ||
|
env.CHANGE_AUTHOR != 'scalz' && env.CHANGE_AUTHOR != 'tbowmo' &&
|
||||||
env.CHANGE_AUTHOR != 'tekka007' || env.CHANGE_AUTHOR != 'user2684' ||
|
env.CHANGE_AUTHOR != 'tekka007' && env.CHANGE_AUTHOR != 'user2684' &&
|
||||||
env.CHANGE_AUTHOR != 'Yveaux'))
|
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!"
|
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) {
|
dir(config.repository_root) {
|
||||||
step([$class: 'GitChangelogRecorder', config: [configFile: 'git-changelog-settings.json',
|
step([$class: 'GitChangelogRecorder', config: [configFile: 'git-changelog-settings.json',
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ def call(Closure body) {
|
|||||||
stage('ArduinoMega (tests)') {
|
stage('ArduinoMega (tests)') {
|
||||||
arduino.buildArduinoMega(config, config.tests, 'Tests')
|
arduino.buildArduinoMega(config, config.tests, 'Tests')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}, ArduinoExampleBuilds: {
|
||||||
|
lock(quantity: 1, resource: 'arduinoExampleEnv') {
|
||||||
stage('MySensorsMicro (examples)') {
|
stage('MySensorsMicro (examples)') {
|
||||||
arduino.buildMySensorsMicro(config, config.examples, 'Examples')
|
arduino.buildMySensorsMicro(config, config.examples, 'Examples')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ def cppCheck(config) {
|
|||||||
sh """#!/bin/bash +x
|
sh """#!/bin/bash +x
|
||||||
cd ${config.repository_root}
|
cd ${config.repository_root}
|
||||||
echo "Doing cppcheck for AVR..."
|
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=."""
|
cppcheck-htmlreport --file="cppcheck-avr.xml" --title="cppcheck-avr" --report-dir=cppcheck-avr_cppcheck_reports --source-dir=."""
|
||||||
|
|
||||||
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true,
|
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ OPTIONS="--quiet \
|
|||||||
--force \
|
--force \
|
||||||
--enable=style,information \
|
--enable=style,information \
|
||||||
-DCPPCHECK \
|
-DCPPCHECK \
|
||||||
|
--language=c++ \
|
||||||
--library=${LIBRARY:-avr} \
|
--library=${LIBRARY:-avr} \
|
||||||
--platform="${TOOLCONFIG}"/${PLATFORM:-avr.xml} \
|
--platform="${TOOLCONFIG}"/${PLATFORM:-avr.xml} \
|
||||||
--includes-file="${TOOLCONFIG}"/includes.cfg \
|
--includes-file="${TOOLCONFIG}"/includes.cfg \
|
||||||
|
|||||||
@@ -7,11 +7,15 @@
|
|||||||
# --cached or <no arg> for changed
|
# --cached or <no arg> for changed
|
||||||
if [[ $# = 0 ]]; then
|
if [[ $# = 0 ]]; then
|
||||||
for file in $(modifiedSourceFiles); do
|
for file in $(modifiedSourceFiles); do
|
||||||
runBundle $file
|
if [[ $file != *.h ]]; then
|
||||||
|
runBundle $file
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
elif [[ $1 = '--cached' ]]; then
|
elif [[ $1 = '--cached' ]]; then
|
||||||
for file in $(stagedSourceFiles); do
|
for file in $(stagedSourceFiles); do
|
||||||
runBundle $file
|
if [[ $file != *.h ]]; then
|
||||||
|
runBundle $file
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
eval "set -- $(git rev-parse --sq --prefix "$GIT_PREFIX" "$@")"
|
eval "set -- $(git rev-parse --sq --prefix "$GIT_PREFIX" "$@")"
|
||||||
|
|||||||
Reference in New Issue
Block a user