SDK_HOME="$HOME/sdk"
SDK_PATH=https://downloads.lede-project.org/snapshots/targets/ar71xx/generic/
-SDK=lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64
+SDK=openwrt-sdk-ar71xx-generic_gcc-5.5.0_musl.Linux-x86_64
PACKAGES_DIR="$PWD"
echo_red() { printf "\033[1;31m$*\033[m\n"; }
while :;do sleep 590;echo "still running (please don't kill me Travis)";done &
("$@" 2>&1) | tee logoutput
R=${PIPESTATUS[0]}
- kill $!
+ kill $! && wait $! 2>/dev/null
if [ $R -ne 0 ]; then
echo_red "=> '$*' failed (return code $R)"
return 1
wget "$SDK_PATH/sha256sums.gpg" -O sha256sums.asc
# LEDE Build System (LEDE GnuPG key for unattended build jobs)
- gpg --recv 0xCD84BCED626471F1
+ gpg --import $PACKAGES_DIR/.travis/626471F1.asc
+ echo '54CC74307A2C6DC9CE618269CD84BCED626471F1:6:' | gpg --import-ownertrust
# LEDE Release Builder (17.01 "Reboot" Signing Key)
- gpg --recv 0x833C6010D52BBB6B
+ gpg --import $PACKAGES_DIR/.travis/D52BBB6B.asc
+ echo 'B09BE781AE8A0CD4702FDCD3833C6010D52BBB6B:6:' | gpg --import-ownertrust
+
gpg --verify sha256sums.asc
grep "$SDK" sha256sums > sha256sums.small
# test_package will run on the `script` step.
# test_package call make download check for very new/modified package
test_packages2() {
+ local commit_range=$TRAVIS_COMMIT_RANGE
+ if [ -z "$TRAVIS_PULL_REQUEST_SHA" ]; then
+ echo_blue "Using only the latest commit, since we're not in a Pull Request"
+ commit_range=HEAD~1
+ fi
+
# search for new or modified packages. PKGS will hold a list of package like 'admin/muninlite admin/monit ...'
- PKGS=$(git diff --diff-filter=d --name-only "$TRAVIS_COMMIT_RANGE" | grep 'Makefile$' | grep -v '/files/' | awk -F'/Makefile' '{ print $1 }')
+ PKGS=$(git diff --diff-filter=d --name-only "$commit_range" | grep 'Makefile$' | grep -v '/files/' | awk -F'/Makefile' '{ print $1 }')
if [ -z "$PKGS" ] ; then
echo_blue "No new or modified packages found!"
# enable BUILD_LOG
sed -i '1s/^/config BUILD_LOG\n\tbool\n\tdefault y\n\n/' Config-build.in
- ./scripts/feeds update -a
- ./scripts/feeds install -a
- make defconfig
+ ./scripts/feeds update -a > /dev/null
+ ./scripts/feeds install -a > /dev/null
+ make defconfig > /dev/null
echo_blue "=== Setting up SDK done"
RET=0
# we can't enable verbose built else we often hit Travis limits
# on log size and the job get killed
- exec_status '^ERROR' make "package/$pkg_name/compile" -j3
+ exec_status '^ERROR' make "package/$pkg_name/compile" -j3 || RET=1
echo_blue "=== $pkg_name: compile test done"
echo_blue "=== $pkg_name: begin compile logs"
- cat logs/package/feeds/packages/$pkg_name/compile.txt
+ for f in $(find logs/package/feeds/packages/$pkg_name/ -type f); do
+ echo_blue "Printing last 200 lines of $f"
+ tail -n200 "$f"
+ done
echo_blue "=== $pkg_name: end compile logs"
+
+ echo_blue "=== $pkg_name: begin packages sizes"
+ du -ba bin/
+ echo_blue "=== $pkg_name: end packages sizes"
done
- return 0
+ return $RET
}
test_commits() {
RET=0
+ if [ -z "$TRAVIS_PULL_REQUEST_SHA" ]; then
+ echo_blue "Skipping commits tests (not in a Pull Request)"
+ return 0
+ fi
for commit in $(git rev-list ${TRAVIS_COMMIT_RANGE/.../..}); do
echo_blue "=== Checking commit '$commit'"
if git show --format='%P' -s $commit | grep -qF ' '; then
fi
subject="$(git show -s --format=%s $commit)"
- if echo "$subject" | grep -q -e '^[0-9A-Za-z,/-]\+: ' -e '^Revert '; then
+ if echo "$subject" | grep -q -e '^[0-9A-Za-z,/_-]\+: ' -e '^Revert '; then
echo_green "Commit subject line seems ok ($subject)"
else
echo_red "Commit subject line MUST start with '<package name>: ' ($subject)"
env
echo_blue "=== Travis ENV"
-while true; do
- # if clone depth is too small, git rev-list / diff return incorrect or empty results
- C="$(git rev-list ${TRAVIS_COMMIT_RANGE/.../..} | tail -n1)" 2>/dev/null
- [ -n "$C" -a "$C" != "a22de9b74cf9579d1ce7e6cf1845b4afa4277b00" ] && break
- echo_blue "Fetching 50 commits more"
- git fetch origin --deepen=50
-done
-
-if [ "$TRAVIS_PULL_REQUEST" = false ] ; then
- echo "Only Pull Requests are supported at the moment." >&2
- exit 0
+if [ -n "$TRAVIS_PULL_REQUEST_SHA" ]; then
+ while true; do
+ # if clone depth is too small, git rev-list / diff return incorrect or empty results
+ C="$(git rev-list ${TRAVIS_COMMIT_RANGE/.../..} | tail -n1)" 2>/dev/null
+ [ -n "$C" -a "$C" != "a22de9b74cf9579d1ce7e6cf1845b4afa4277b00" ] && break
+ echo_blue "Fetching 50 commits more"
+ git fetch origin --deepen=50
+ done
fi
-
if [ $# -ne 1 ] ; then
cat <<EOF
Usage: $0 (download_sdk|test_packages)