tools/ci.sh: Allow errors in code-size build to fail the CI.
It was possible for CI to pass even if the bare-arm port fails to build. This commit fixes that. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
15
tools/ci.sh
15
tools/ci.sh
@@ -93,23 +93,30 @@ function ci_code_size_build {
|
|||||||
function code_size_build_step {
|
function code_size_build_step {
|
||||||
COMMIT=$1
|
COMMIT=$1
|
||||||
OUTFILE=$2
|
OUTFILE=$2
|
||||||
IGNORE_ERRORS=$3
|
|
||||||
|
|
||||||
echo "Building ${COMMIT}..."
|
echo "Building ${COMMIT}..."
|
||||||
git checkout --detach $COMMIT
|
git checkout --detach $COMMIT
|
||||||
git submodule update --init $SUBMODULES
|
git submodule update --init $SUBMODULES
|
||||||
git show -s
|
git show -s
|
||||||
tools/metrics.py clean $PORTS_TO_CHECK
|
tools/metrics.py clean $PORTS_TO_CHECK
|
||||||
tools/metrics.py build $PORTS_TO_CHECK | tee $OUTFILE || $IGNORE_ERRORS
|
tools/metrics.py build $PORTS_TO_CHECK | tee $OUTFILE
|
||||||
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Allow errors from tools/metrics.py to propagate out of the pipe above.
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
# build reference, save to size0
|
# build reference, save to size0
|
||||||
# ignore any errors with this build, in case master is failing
|
# ignore any errors with this build, in case master is failing
|
||||||
code_size_build_step $REFERENCE ~/size0 true
|
code_size_build_step $REFERENCE ~/size0
|
||||||
# build PR/branch, save to size1
|
# build PR/branch, save to size1
|
||||||
code_size_build_step $COMPARISON ~/size1 false
|
code_size_build_step $COMPARISON ~/size1
|
||||||
|
STATUS=$?
|
||||||
|
|
||||||
|
set +o pipefail
|
||||||
unset -f code_size_build_step
|
unset -f code_size_build_step
|
||||||
|
|
||||||
|
return $STATUS
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user