2015-11-18 13:36:51 +01:00
|
|
|
#!/usr/bin/env bash
|
2015-02-24 00:23:34 +01:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 Philipp Rosenkranz <philipp.rosenkranz@fu-berlin.de>
|
|
|
|
#
|
|
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
# directory for more details.
|
|
|
|
#
|
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
CI_BASE_BRANCH=${CI_BASE_BRANCH:-master}
|
|
|
|
|
2015-02-24 00:17:28 +01:00
|
|
|
if [[ $BUILDTEST_MCU_GROUP ]]
|
|
|
|
then
|
2015-05-20 14:10:34 +02:00
|
|
|
|
2015-02-28 18:56:48 +01:00
|
|
|
if [ "$BUILDTEST_MCU_GROUP" == "static-tests" ]
|
|
|
|
then
|
2015-02-28 19:16:48 +01:00
|
|
|
RESULT=0
|
2016-03-01 13:54:04 +01:00
|
|
|
RECALL="$1"
|
2015-02-28 19:16:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
if git diff ${CI_BASE_BRANCH} HEAD -- .travis.yml &> /dev/null; then
|
2016-02-28 20:44:27 +01:00
|
|
|
# check if .travis.yml was changed in the current PR and skip if so
|
2016-07-13 16:04:26 +02:00
|
|
|
if ! git diff --name-only $(git merge-base HEAD ${CI_BASE_BRANCH})..HEAD -- \
|
2016-02-28 20:44:27 +01:00
|
|
|
.travis.yml &> 1; then
|
|
|
|
echo "==============================================================" >&2
|
|
|
|
echo -e "\033[1;31m.travis.yml differs in upstream.\033[0m"
|
|
|
|
echo -e "\033[1;31mPlease rebase your PR to current upstream or expect errors!!!!\033[0m" >&2
|
2016-07-13 16:04:26 +02:00
|
|
|
echo " git fetch https://github.com/RIOT-OS/RIOT ${CI_BASE_BRANCH}" >&2
|
2016-02-28 20:44:27 +01:00
|
|
|
echo " git rebase FETCH_HEAD" >&2
|
|
|
|
echo " git push -f origin $(git rev-parse --abbrev-ref HEAD)" >&2
|
|
|
|
echo "==============================================================" >&2
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-03-01 13:54:04 +01:00
|
|
|
if [ "$RECALL" != "recall" ]; then
|
2016-07-13 16:04:26 +02:00
|
|
|
if git diff ${CI_BASE_BRANCH} HEAD -- "$0" &> /dev/null; then
|
|
|
|
git rebase ${CI_BASE_BRANCH} || git rebase --abort
|
2016-03-01 13:54:04 +01:00
|
|
|
|
|
|
|
"$0" "recall"
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-03-02 12:10:44 +01:00
|
|
|
trap "RESULT=1" ERR
|
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
git rebase ${CI_BASE_BRANCH} || git rebase --abort
|
2016-03-02 12:10:44 +01:00
|
|
|
if [ $RESULT -ne 0 ]; then
|
|
|
|
exit $RESULT
|
|
|
|
fi
|
2015-02-28 18:56:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
./dist/tools/whitespacecheck/check.sh ${CI_BASE_BRANCH}
|
2015-02-28 18:56:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
./dist/tools/licenses/check.sh ${CI_BASE_BRANCH} --diff-filter=MR --error-exitcode=0
|
2015-02-28 19:16:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
./dist/tools/licenses/check.sh ${CI_BASE_BRANCH} --diff-filter=AC
|
2015-02-28 18:56:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
./dist/tools/doccheck/check.sh ${CI_BASE_BRANCH}
|
2015-02-28 18:56:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
./dist/tools/externc/check.sh ${CI_BASE_BRANCH}
|
2015-02-28 18:56:48 +01:00
|
|
|
|
|
|
|
# TODO:
|
2016-07-13 16:04:26 +02:00
|
|
|
# Remove all but `${CI_BASE_BRANCH}` parameters to cppcheck (and remove second
|
2015-02-28 18:56:48 +01:00
|
|
|
# invocation) once all warnings of cppcheck have been taken care of
|
2016-07-13 16:04:26 +02:00
|
|
|
# in ${CI_BASE_BRANCH}.
|
|
|
|
./dist/tools/cppcheck/check.sh ${CI_BASE_BRANCH} --diff-filter=MR --error-exitcode=0
|
2015-02-28 19:16:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
./dist/tools/cppcheck/check.sh ${CI_BASE_BRANCH} --diff-filter=AC
|
2015-02-28 19:16:48 +01:00
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
./dist/tools/pr_check/pr_check.sh ${CI_BASE_BRANCH}
|
2015-02-28 19:16:48 +01:00
|
|
|
|
|
|
|
exit $RESULT
|
2015-02-28 18:56:48 +01:00
|
|
|
fi
|
|
|
|
|
2016-04-14 16:49:52 +02:00
|
|
|
if [ "$BUILDTEST_MCU_GROUP" == "host" ]; then
|
|
|
|
make -C dist/tools
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
|
2015-05-26 19:28:44 +02:00
|
|
|
if [ "$BUILDTEST_MCU_GROUP" == "x86" ]
|
|
|
|
then
|
2016-03-23 23:52:00 +01:00
|
|
|
make -C ./tests/unittests all-debug test BOARD=native TERMPROG='gdb -batch -ex r -ex bt $(ELF)' || exit
|
2015-05-26 19:28:44 +02:00
|
|
|
# TODO:
|
|
|
|
# Reenable once https://github.com/RIOT-OS/RIOT/issues/2300 is
|
|
|
|
# resolved:
|
|
|
|
# - make -C ./tests/unittests all test BOARD=qemu-i386 || exit
|
2015-02-28 18:56:48 +01:00
|
|
|
fi
|
2016-03-15 00:08:18 +01:00
|
|
|
BASE_BRANCH="${TRAVIS_BRANCH:-${CI_BASE_BRANCH}}"
|
|
|
|
./dist/tools/compile_test/compile_test.py $BASE_BRANCH
|
2015-02-06 03:36:16 +01:00
|
|
|
fi
|