Skip to content

Commit 9b630f7

Browse files
fallbergtekka007
authored andcommitted
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
1 parent e6cef8b commit 9b630f7

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

.ci/gitler.groovy

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
def call(config) {
33
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Gitler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
44
if (env.CHANGE_TARGET == 'master' &&
5-
(env.CHANGE_AUTHOR != 'bblacey' || env.CHANGE_AUTHOR != 'd00616' ||
6-
env.CHANGE_AUTHOR != 'fallberg' || env.CHANGE_AUTHOR != 'henrikekblad' ||
7-
env.CHANGE_AUTHOR != 'marceloaqno' || env.CHANGE_AUTHOR != 'mfalkvidd' ||
8-
env.CHANGE_AUTHOR != 'scalz' || env.CHANGE_AUTHOR != 'tbowmo' ||
9-
env.CHANGE_AUTHOR != 'tekka007' || env.CHANGE_AUTHOR != 'user2684' ||
5+
(env.CHANGE_AUTHOR != 'bblacey' && env.CHANGE_AUTHOR != 'd00616' &&
6+
env.CHANGE_AUTHOR != 'fallberg' && env.CHANGE_AUTHOR != 'henrikekblad' &&
7+
env.CHANGE_AUTHOR != 'marceloaqno' && env.CHANGE_AUTHOR != 'mfalkvidd' &&
8+
env.CHANGE_AUTHOR != 'scalz' && env.CHANGE_AUTHOR != 'tbowmo' &&
9+
env.CHANGE_AUTHOR != 'tekka007' && env.CHANGE_AUTHOR != 'user2684' &&
1010
env.CHANGE_AUTHOR != 'Yveaux'))
1111
{
12-
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'This pull request targets master. That is not permitted!', '')
12+
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'This pull request targets master. That is not permitted for '+env.CHANGE_AUTHOR, '')
1313
error "This pull request targets master. That is not permitted!"
1414
}
15+
else if (env.CHANGE_TARGET == 'master')
16+
{
17+
echo env.CHANGE_AUTHOR + ' is a valid author for targeting master branch, skipping further validation'
18+
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Gitler)', 'Pass', '')
19+
return
20+
}
1521

1622
dir(config.repository_root) {
1723
step([$class: 'GitChangelogRecorder', config: [configFile: 'git-changelog-settings.json',
@@ -102,4 +108,4 @@ def call(config) {
102108
}
103109
}
104110

105-
return this
111+
return this

.ci/pipeline.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ def call(Closure body) {
121121
stage('ArduinoMega (tests)') {
122122
arduino.buildArduinoMega(config, config.tests, 'Tests')
123123
}
124+
}
125+
}, ArduinoExampleBuilds: {
126+
lock(quantity: 1, resource: 'arduinoExampleEnv') {
124127
stage('MySensorsMicro (examples)') {
125128
arduino.buildMySensorsMicro(config, config.examples, 'Examples')
126129
}

.ci/static_analysis.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def cppCheck(config) {
55
sh """#!/bin/bash +x
66
cd ${config.repository_root}
77
echo "Doing cppcheck for AVR..."
8-
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
8+
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
99
cppcheck-htmlreport --file="cppcheck-avr.xml" --title="cppcheck-avr" --report-dir=cppcheck-avr_cppcheck_reports --source-dir=."""
1010

1111
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true,

.mystools/cppcheck/options.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ OPTIONS="--quiet \
55
--force \
66
--enable=style,information \
77
-DCPPCHECK \
8+
--language=c++ \
89
--library=${LIBRARY:-avr} \
910
--platform="${TOOLCONFIG}"/${PLATFORM:-avr.xml} \
1011
--includes-file="${TOOLCONFIG}"/includes.cfg \

.mystools/cppcheck/run.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77
# --cached or <no arg> for changed
88
if [[ $# = 0 ]]; then
99
for file in $(modifiedSourceFiles); do
10-
runBundle $file
10+
if [[ $file != *.h ]]; then
11+
runBundle $file
12+
fi
1113
done
1214
elif [[ $1 = '--cached' ]]; then
1315
for file in $(stagedSourceFiles); do
14-
runBundle $file
16+
if [[ $file != *.h ]]; then
17+
runBundle $file
18+
fi
1519
done
1620
else
1721
eval "set -- $(git rev-parse --sq --prefix "$GIT_PREFIX" "$@")"

0 commit comments

Comments
 (0)