Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gjanssens committed Sep 10, 2017
2 parents f0fe1e9 + 121dd8c commit f0f53d9
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 70 deletions.
36 changes: 15 additions & 21 deletions .travis.yml
@@ -1,26 +1,20 @@
# Test
sudo: required
dist: trusty
branches:
except:
- trunk
language: c++
compiler:
- gcc
# - clang
compiler: gcc
env:
- BUILDTYPE=cmake-make
- BUILDTYPE=cmake-ninja
- BUILDTYPE=autotools
before_install:
# - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- BUILDENV=arch BUILDTYPE=cmake-make
- BUILDENV=arch BUILDTYPE=cmake-ninja
- BUILDENV=arch BUILDTYPE=autotools
- BUILDENV=ubuntu-14.04 BUILDTYPE=cmake-make
- BUILDENV=ubuntu-14.04 BUILDTYPE=cmake-ninja
- BUILDENV=ubuntu-14.04 BUILDTYPE=autotools
services:
- docker
install:
# - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.9; export CXX="g++-4.9" CC="gcc-4.9"; fi
- sudo apt-get build-dep -qq gnucash
- sudo apt-get install -qq swig xsltproc libdbd-sqlite3 cmake3 texinfo ninja-build
- sudo apt-get install -qq libboost-all-dev libgtk-3-dev libwebkit2gtk-3.0-dev
- sudo apt-get --reinstall install -qq language-pack-en language-pack-fr
- git clone https://github.com/google/googletest -b release-1.8.0 ~/gtest
script: ./util/travis-script.sh
after_failure: ./util/travis-after-failure.sh
- docker --version
- echo BUILDENV="$BUILDENV"
- docker build -f util/ci/${BUILDENV}-docker -t ${BUILDENV}-gnucashbuild util/ci
script:
- echo BUILDTYPE="$BUILDTYPE"
- docker run -v "$(pwd)":/gnucash:rw --env="BUILDTYPE=$BUILDTYPE" --rm ${BUILDENV}-gnucashbuild
23 changes: 23 additions & 0 deletions util/ci/afterfailure
@@ -0,0 +1,23 @@
#!/bin/bash

if [[ "$BUILDTYPE" == "cmake-make" ]] || [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
echo "########################";
echo "##### LastTest.log #####";
echo "########################";
cat /build/Testing/Temporary/LastTest.log;
elif [[ "$BUILDTYPE" == "autotools" ]]; then
find . -name 'test*.log' -print0 |
while IFS= read -r -d '' logfile; do
SIZE=$((${#logfile} + 12));
HRULE=$(head -c "$SIZE" < /dev/zero | tr '\0' '#');
echo $HRULE;
echo "##### ${logfile} #####";
echo $HRULE;
cat -- "$logfile";
echo $'\n'$'\n';
done;
else
echo "Unknown BUILDTYPE: \"$BUILDTYPE\", cannot create failure information.";
fi
# This script should fail so that the entire script will fail.
exit 1;
11 changes: 11 additions & 0 deletions util/ci/arch-docker
@@ -0,0 +1,11 @@
from base/archlinux
#run pacman -Syu --quiet --noconfirm > /dev/null
#run pacman -S --noconfirm archlinux-keyring
run pacman -Syu --quiet --noconfirm gcc cmake make autoconf automake boost python2 pkg-config guile2.0 guile git ninja gtest gmock sqlite3 webkit2gtk swig gwenhywfar aqbanking intltool libxslt postgresql-libs libmariadbclient libdbi libdbi-drivers > /dev/null
run echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
run echo en_GB.UTF-8 UTF-8 >> /etc/locale.gen
run echo fr_FR.UTF-8 UTF-8 >> /etc/locale.gen
run locale-gen
copy arch-testscript afterfailure commonbuild /
run chmod +x /arch-testscript /afterfailure /commonbuild
entrypoint /arch-testscript
18 changes: 18 additions & 0 deletions util/ci/arch-testscript
@@ -0,0 +1,18 @@
#!/bin/bash -le

#-l above (login shell) so that /etc/profile runs so that perl is
# on the path.

#-e so that if any command has an exit code != 0, this script will
# exit immediately.

# Python is python 3, but gnucash doesn't work with python 3. There
# doesn't seem to be a way to tell automake to use /usr/bin/python2,
# so we'll mock this up
mkdir autotools_bin;
ln -s /usr/bin/python2 autotools_bin/python;
export PATH=/autotools_bin:"$PATH";
echo path is "$PATH";
echo python version is "$(python --version)";

../commonbuild
25 changes: 25 additions & 0 deletions util/ci/commonbuild
@@ -0,0 +1,25 @@
#!/bin/bash -e

mkdir build;
cd build;
export TZ="America/Los_Angeles";

mkdir -p /root/.local/share;

if [[ "$BUILDTYPE" == "cmake-make" ]]; then
cmake ../gnucash
make -j 4;
make check || ../afterfailure;
elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
cmake ../gnucash -DCMAKE_BUILD_TYPE=debug -DENABLE_DEBUG=on -G Ninja
ninja
ninja check || ../afterfailure;
elif [[ "$BUILDTYPE" == "autotools" ]]; then
../gnucash/autogen.sh;
../gnucash/configure --enable-python;
make;
make check || ../afterfailure;
else
echo "Unknown buildtype: \"$BUILDTYPE\". Not building.";
fi

11 changes: 11 additions & 0 deletions util/ci/ubuntu-14.04-docker
@@ -0,0 +1,11 @@
from ubuntu:14.04
#sudo apt-get install -qq software-properties-common
#sudo add-apt-repository -qq ppa:george-edison55/cmake-3.x
run apt-get update -qq
run apt-get build-dep -qq gnucash > /dev/null
run apt-get install -qq git bash-completion cmake3 make swig xsltproc libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev libwebkit2gtk-3.0-dev > /dev/null
run apt-get --reinstall install -qq language-pack-en language-pack-fr
run git clone https://github.com/google/googletest -b release-1.8.0 gtest
copy ubuntu-14.04-testscript afterfailure commonbuild /
run chmod +x /ubuntu-14.04-testscript /afterfailure /commonbuild
entrypoint /ubuntu-14.04-testscript
8 changes: 8 additions & 0 deletions util/ci/ubuntu-14.04-testscript
@@ -0,0 +1,8 @@
#!/bin/bash -e

# -e above so that if any command has an exit code != 0, this script will
# exit immediately.

export GTEST_ROOT=/gtest/googletest GMOCK_ROOT=/gtest/googlemock;

../commonbuild
19 changes: 0 additions & 19 deletions util/travis-after-failure.sh

This file was deleted.

30 changes: 0 additions & 30 deletions util/travis-script.sh

This file was deleted.

0 comments on commit f0f53d9

Please sign in to comment.