.travis.yml: test build packages on travis.

This commit is contained in:
Enno Boland 2015-04-10 00:53:46 +02:00
parent cad5db125c
commit 8351befa28
8 changed files with 97 additions and 5 deletions

View file

@ -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

12
common/travis/bootstrap.sh Executable file
View file

@ -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

12
common/travis/build.sh Executable file
View file

@ -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

View file

@ -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

View file

@ -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

22
common/travis/prepare.sh Executable file
View file

@ -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

11
common/travis/show_files.sh Executable file
View file

@ -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

5
common/travis/xlint.sh Executable file
View file

@ -0,0 +1,5 @@
#! /bin/sh
#
# xlint.sh
awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates | xargs xlint