diff --git a/.travis.yml b/.travis.yml index a8c951c2695..8cba68816a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,37 @@ language: bash +sudo: false + git: depth: 200 env: global: - - PATH=$PATH:$PWD/xtools + - PATH=$PATH:$HOME/bin + + matrix: + - ARCH=x86_64 + - ARCH=i686 + - ARCH=armv6hf + - ARCH=armv7hf +cache: + directories: + - $HOME/repocache +before_cache: + - mv hostdir/repocache/* $HOME/repocache before_script: - - git clone --depth 1 git://github.com/chneukirchen/xtools.git xtools + - common/travis/prepare.sh + - common/travis/fetch_upstream.sh + - common/travis/changed_templates.sh + - common/travis/xlint.sh + - common/travis/bootstrap.sh script: - - git fetch --depth 200 git://github.com/voidlinux/void-packages.git master - - git diff --name-status FETCH_HEAD...HEAD | grep "^[AM].*srcpkgs/[^/]*/template$" | awk '{print $2}' | tee __changed_templates - - xlint `cat __changed_templates` + - common/travis/build.sh $ARCH + +after_script: + - common/travis/show_files.sh notifications: email: false diff --git a/common/travis/bootstrap.sh b/common/travis/bootstrap.sh new file mode 100755 index 00000000000..70dbc1335ee --- /dev/null +++ b/common/travis/bootstrap.sh @@ -0,0 +1,12 @@ +#! /bin/sh +# +# bootstrap.sh + +mkdir -p hostdir/repocache +if [ -d $HOME/repocache ]; then + ln $HOME/repocache/* hostdir/repocache; +else + mkdir -p $HOME/repocache +fi + +./xbps-src binary-bootstrap diff --git a/common/travis/build.sh b/common/travis/build.sh new file mode 100755 index 00000000000..cc751201e41 --- /dev/null +++ b/common/travis/build.sh @@ -0,0 +1,12 @@ +#! /bin/sh +# +# build.sh + +if [ "$1" != x86_64 ]; then + arch="-a $1" +fi + +for pkg in $(cat /tmp/templates); do + ./xbps-src $arch -C pkg "$pkg" || exit 1 +done + diff --git a/common/travis/changed_templates.sh b/common/travis/changed_templates.sh new file mode 100755 index 00000000000..1f7579a7038 --- /dev/null +++ b/common/travis/changed_templates.sh @@ -0,0 +1,6 @@ +#! /bin/sh +# +# changed_templates.sh + +/bin/echo -e '\x1b[32mChanged packages:\x1b[0m' +git diff --name-status FETCH_HEAD...HEAD | grep "^[AM].*srcpkgs/[^/]*/template$" | cut -d/ -f 2 | tee /tmp/templates | sed "s/^/ /" >&2 diff --git a/common/travis/fetch_upstream.sh b/common/travis/fetch_upstream.sh new file mode 100755 index 00000000000..47ab226d438 --- /dev/null +++ b/common/travis/fetch_upstream.sh @@ -0,0 +1,6 @@ +#! /bin/sh +# +# changed_templates.sh + +/bin/echo -e '\x1b[32mFetching upstream...\x1b[0m' +git fetch --depth 200 git://github.com/voidlinux/void-packages.git master diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh new file mode 100755 index 00000000000..a9dbece6de0 --- /dev/null +++ b/common/travis/prepare.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# install_tools.sh + +mkdir -p $HOME/bin + +/bin/echo -e '\x1b[32mInstalling proot...\x1b[0m' +wget -q http://static.proot.me/proot-x86_64 +install -m 755 proot-x86_64 $HOME/bin/proot || exit 1 + +/bin/echo -e '\x1b[32mInstalling xbps...\x1b[0m' +wget -q -O - http://repo.voidlinux.eu/static/xbps-static-latest.x86_64-musl.tar.xz | \ + unxz | tar x -C $HOME/bin --wildcards "./usr/sbin/xbps-*" \ + --strip-components=3 || exit 1 + +/bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m' +wget -q -O - https://github.com/chneukirchen/xtools/archive/master.tar.gz | \ + gunzip | tar x -C $HOME/bin --wildcards "xtools-master/x*" \ + --strip-components=1 || exit 1 + +/bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m' +echo XBPS_CHROOT_CMD=proot >> etc/conf diff --git a/common/travis/show_files.sh b/common/travis/show_files.sh new file mode 100755 index 00000000000..8756471e158 --- /dev/null +++ b/common/travis/show_files.sh @@ -0,0 +1,11 @@ +#! /bin/sh +# +# build.sh + +for pkg in $(cat /tmp/templates); do + for subpkg in $(xsubpkg $pkg); do + /bin/echo -e "\x1b[32mFiles of $subpkg:\x1b[0m" + ./xbps-src show-files "$pkg" + done +done + diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh new file mode 100755 index 00000000000..582ebed9a94 --- /dev/null +++ b/common/travis/xlint.sh @@ -0,0 +1,5 @@ +#! /bin/sh +# +# xlint.sh + +awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates | xargs xlint