Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[travis] Use containerized builds (#3327)
* Add some debug output when GDALRasterIO operations fail

Or the compiler will complain about unhandled returns

* [travis] Use containerized builds
  • Loading branch information
m-kuhn committed Jul 23, 2016
1 parent 326b6ff commit 2ebd0eb
Show file tree
Hide file tree
Showing 18 changed files with 376 additions and 131 deletions.
71 changes: 58 additions & 13 deletions .travis.yml
@@ -1,23 +1,71 @@
language: cpp

matrix:
fast_finish: true
allow_failures:
- os: osx
include:
# QT4 based build with Python 2.7 // using container based builds and prebuild binary dependencies in osgeo4travis
- os: linux
sudo: required
dist: precise
group: legacy
compiler: clang
language: cpp
env:
- BUILD=qt4
- QT_VERSION=4
# - LLVM_VERSION=3.8
sudo: false
cache:
apt: true
directories:
- $HOME/.ccache
compiler: gcc
addons:
postgresql: "9.4"
apt:
sources:
# - llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
- george-edison55-precise-backports # doxygen 1.8.3
packages:
- bison
- gcc-6
- g++-6
- doxygen
- flex
- flip
- libfcgi-dev
- libfftw3-3
- libpq-dev
- libqscintilla2-dev
- libqt4-dev
- libqt4-opengl-dev
- libqt4-sql-sqlite
- libqtwebkit-dev
- libqwt-dev
- libspatialindex-dev
- libspatialite-dev
- libsqlite3-dev
- pkg-config
- poppler-utils
- pyqt4-dev-tools
- python
- python-dev
- python-numpy
- python-pip
- python-psycopg2
- python-qscintilla2
- python-qt4-dev
- python-qt4-sql
- python-sip
- python-sip-dev
- txt2tags
- xvfb
# OSX based build with QT4 and Python 2
- os: osx
compiler: clang

env:
- BUILD=osx
- IGNORE_BUILD_FAILURES=YES

git:
depth: 30

cache: apt

notifications:
irc: "chat.freenode.net#qgis-test"
on_failure: change
Expand All @@ -32,9 +80,6 @@ notifications:
on_failure: always # options: [always|never|change] default: always
on_start: never # default: never

addons:
postgresql: "9.1"

before_install:
- ./ci/travis/${TRAVIS_OS_NAME}/before_install.sh

Expand Down
15 changes: 15 additions & 0 deletions ci/travis/linux/after_script.sh
@@ -1 +1,16 @@
###########################################################################
# after_script.sh
# ---------------------
# Date : September 2015
# Copyright : (C) 2015 by Matthias Kuhn
# Email : matthias at opengis dot ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

[ -r /tmp/ctest-important.log ] && cat /tmp/ctest-important.log
80 changes: 17 additions & 63 deletions ci/travis/linux/before_install.sh
@@ -1,65 +1,19 @@
export DEBIAN_FRONTEND=noninteractive
#!/bin/bash
###########################################################################
# before_install.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

sudo add-apt-repository ppa:ubuntugis/ppa -y
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y # For postgresql-9.1-postgis-2.1
sudo add-apt-repository ppa:smspillaz/cmake-3.0.2 -y
sudo add-apt-repository ppa:kedazo/doxygen-updates-precise -y # For doxygen 1.8.8
sudo apt-get update -qq
sudo apt-get install --force-yes --no-install-recommends --no-install-suggests \
bison \
cmake \
cmake-data \
doxygen \
flex \
gdal-bin \
git \
graphviz \
grass-dev \
libexpat1-dev \
libfcgi-dev \
libgdal1-dev \
libgeos-dev \
libgsl0-dev \
libpq-dev \
libproj-dev \
libqca2-dev \
libqca2-plugin-ossl \
libqscintilla2-dev \
libqt4-dev \
libqt4-opengl-dev \
libqt4-sql-sqlite \
libqtwebkit-dev \
libqwt-dev \
libspatialindex-dev \
libspatialite-dev \
libsqlite3-dev \
lighttpd \
pkg-config \
poppler-utils \
pyqt4-dev-tools \
python \
python-dev \
python-qt4 \
python-qt4-dev \
python-qt4-sql \
python-qscintilla2 \
python-sip \
python-sip-dev \
python-psycopg2 \
python-numpy \
python-gdal \
spawn-fcgi \
txt2tags \
xauth \
xfonts-100dpi \
xfonts-75dpi \
xfonts-base \
xfonts-scalable \
xvfb \
python-pip \
flip \
jq \
postgresql-9.1-postgis-2.1/precise # from ubuntugis-unstable, not pgdg

sudo -H pip install autopep8 # TODO when switching to trusty or above: replace python-pip with python-autopep8
sudo -H pip install nose2 pyyaml mock
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
${DIR}/qt${QT_VERSION}/before_install.sh
15 changes: 15 additions & 0 deletions ci/travis/linux/before_script.sh
@@ -1,3 +1,18 @@
###########################################################################
# before_script.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

printf "[qgis_test]\nhost=localhost\ndbname=qgis_test\nuser=postgres" > ~/.pg_service.conf

export PGUSER=postgres
Expand Down
34 changes: 17 additions & 17 deletions ci/travis/linux/install.sh
@@ -1,19 +1,19 @@
mkdir build
cd build
#!/bin/bash
###########################################################################
# install.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

CLANG_WARNINGS="-Wimplicit-fallthrough"

cmake -DWITH_SERVER=ON \
-DWITH_STAGED_PLUGINS=ON \
-DWITH_GRASS=ON \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=ON \
-DWITH_QWTPOLAR=OFF \
-DWITH_APIDOC=ON \
-DWITH_ASTYLE=ON \
-DWITH_PYSPATIALITE=ON \
-DGRASS_PREFIX7=/usr/lib/grass70 \
-DGRASS_INCLUDE_DIR7=/usr/lib/grass70/include \
-DCXX_EXTRA_FLAGS="$CLANG_WARNINGS" \
..
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
${DIR}/qt${QT_VERSION}/install.sh
24 changes: 24 additions & 0 deletions ci/travis/linux/qt4/before_install.sh
@@ -0,0 +1,24 @@
###########################################################################
# before_install.sh
# ---------------------
# Date : March 2016
# Copyright : (C) 2016 by Matthias Kuhn
# Email : matthias at opengis dot ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

export DEBIAN_FRONTEND=noninteractive

pushd ${HOME}

curl -L https://github.com/opengisch/osgeo4travis/archive/qt4bin.tar.gz | tar -xzC /home/travis --strip-components=1
curl -L https://cmake.org/files/v3.5/cmake-3.5.0-Linux-x86_64.tar.gz | tar --strip-components=1 -zxC /home/travis/osgeo4travis

popd
pip install --user autopep8 nose2 pyyaml mock future
59 changes: 59 additions & 0 deletions ci/travis/linux/qt4/install.sh
@@ -0,0 +1,59 @@
###########################################################################
# install.sh
# ---------------------
# Date : March 2016
# Copyright : (C) 2016 by Matthias Kuhn
# Email : matthias at opengis dot ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

mkdir build
cd build

ln -s ${HOME}/osgeo4travis/bin/ccache ${HOME}/osgeo4travis/bin/clang++-${LLVM_VERSION}
ln -s ${HOME}/osgeo4travis/bin/ccache ${HOME}/osgeo4travis/bin/clang-${LLVM_VERSION}
ln -s ${HOME}/osgeo4travis/bin/ccache ${HOME}/osgeo4travis/bin/g++-6
ln -s ${HOME}/osgeo4travis/bin/ccache ${HOME}/osgeo4travis/bin/gcc-6

ccache -s

#export CXX="clang++-${LLVM_VERSION}"
#export CC="clang-${LLVM_VERSION}"
export CXX="g++-6"
export CC="gcc-6"

export PATH=${HOME}/osgeo4travis/bin:${PATH}

cmake --version
${CC} --version
${CXX} --version

# CLANG_WARNINGS="-Wimplicit-fallthrough"
CLANG_WARNINGS=""

# Include this line for debug reasons
# -DCMAKE_BUILD_TYPE=RelWithDebInfo \
#
cmake \
-DCMAKE_PREFIX_PATH=/home/travis/osgeo4travis \
-DWITH_STAGED_PLUGINS=ON \
-DWITH_GRASS=ON \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=ON \
-DWITH_QSPATIALITE=ON \
-DWITH_QWTPOLAR=OFF \
-DWITH_APIDOC=ON \
-DWITH_ASTYLE=ON \
-DWITH_SERVER=ON \
-DWITH_PYSPATIALITE=ON \
-DGRASS_PREFIX7=/usr/lib/grass70 \
-DGRASS_INCLUDE_DIR7=/usr/lib/grass70/include \
-DCXX_EXTRA_FLAGS="$CLANG_WARNINGS" \
..
27 changes: 27 additions & 0 deletions ci/travis/linux/qt4/script.sh
@@ -0,0 +1,27 @@
###########################################################################
# script.sh
# ---------------------
# Date : March 2016
# Copyright : (C) 2016 by Matthias Kuhn
# Email : matthias at opengis dot ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

export PYTHONPATH=${HOME}/osgeo4travis/lib/python2.7/site-packages/
export PATH=${HOME}/osgeo4travis/bin:${HOME}/osgeo4travis/sbin:${PATH}
export LD_LIBRARY_PATH=${HOME}/osgeo4travis/lib
export CTEST_PARALLEL_LEVEL=1
export CCACHE_CPP2=yes
export CCACHE_TEMPDIR=/tmp
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
export CCACHE_READONLY=yes
chmod -R ugo-w ~/.ccache
fi

xvfb-run ctest -V -E 'qgis_openstreetmaptest|qgis_wcsprovidertest' -S ./qgis-test-travis.ctest --output-on-failure
20 changes: 19 additions & 1 deletion ci/travis/linux/script.sh
@@ -1 +1,19 @@
xvfb-run ctest -V -E 'qgis_openstreetmaptest|qgis_wcsprovidertest' -S ./qgis-test-travis.ctest --output-on-failure
#!/bin/bash
###########################################################################
# script.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################


DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
${DIR}/qt${QT_VERSION}/script.sh

0 comments on commit 2ebd0eb

Please sign in to comment.