Skip to content

Commit

Permalink
Enable multi-os builds for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 12, 2015
1 parent d8d9ba1 commit a477b3a
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 31 deletions.
43 changes: 12 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: cpp

os:
- linux
- osx

compiler:
- clang

Expand All @@ -26,40 +30,17 @@ addons:
postgresql: "9.1"

before_install:
- export DEBIAN_FRONTEND=noninteractive
- 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 git graphviz
grass-dev libexpat1-dev libfcgi-dev libgdal1-dev
libgeos-dev libgsl0-dev libpq-dev libproj-dev
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-sip python-sip-dev spawn-fcgi txt2tags
xauth xfonts-100dpi xfonts-75dpi xfonts-base
xfonts-scalable xvfb
postgresql-9.1-postgis-2.1/precise # postgis one from ubuntugis-unstable, not pgdg
- cmake --version
- clang --version
- "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then ./ci/travis/before_install-linux.sh; fi"
- "if [ ${TRAVIS_OS_NAME:-'linux'} = 'osx' ]; then ./ci/travis/before_install-osx.sh; fi"

install:
- mkdir build
- cd build
- cmake -DWITH_SERVER=ON -DWITH_STAGED_PLUGINS=OFF -DWITH_GRASS=OFF
-DSUPPRESS_QT_WARNINGS=ON -DENABLE_MODELTEST=ON -DENABLE_PGTEST=ON
-DWITH_QWTPOLAR=OFF -DWITH_APIDOC=ON -DWITH_PYSPATIALITE=ON ..
- "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then ./ci/travis/install-linux.sh; fi"
- "if [ ${TRAVIS_OS_NAME:-'linux'} = 'osx' ]; then ./ci/travis/install-osx.sh; fi"

before_script:
- printf "[qgis_test]\nhost=localhost\ndbname=qgis_test\nuser=postgres" > ~/.pg_service.conf
- psql -c 'CREATE DATABASE qgis_test;' -U postgres
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d qgis_test
- psql -f $TRAVIS_BUILD_DIR/tests/testdata/provider/testdata.sql -U postgres -d qgis_test
- "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then ./ci/travis/before_script-linux.sh; fi"

script: xvfb-run ctest -V -E 'qgis_openstreetmaptest|qgis_wcsprovidertest' -S ../qgis-test-travis.ctest --output-on-failure
script:
- "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then ./ci/travis/script-linux.sh; fi"
- "if [ ${TRAVIS_OS_NAME:-'linux'} = 'osx' ]; then ./ci/travis/script-osx.sh; fi"

21 changes: 21 additions & 0 deletions ci/travis/before_install-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export DEBIAN_FRONTEND=noninteractive
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 git graphviz \
grass-dev libexpat1-dev libfcgi-dev libgdal1-dev \
libgeos-dev libgsl0-dev libpq-dev libproj-dev \
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-sip python-sip-dev spawn-fcgi txt2tags \
xauth xfonts-100dpi xfonts-75dpi xfonts-base \
xfonts-scalable xvfb \
postgresql-9.1-postgis-2.1/precise # postgis one from ubuntugis-unstable, not pgdg
cmake --version
clang --version
15 changes: 15 additions & 0 deletions ci/travis/before_install-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
brew tap osgeo/osgeo4mac
brew update
brew install osgeo/osgeo4mac/qgis-28 --only-dependencies
brew install doxygen

brew ln bison --force
brew ln sqlite --force
brew ln openssl --force
brew ln expat --force
brew ln libxml2 --force
brew ln gettext --force
brew ln libffi --force

export HOMEBREW_PREFIX=`brew --prefix`
export PATH=${PATH}:${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin
5 changes: 5 additions & 0 deletions ci/travis/before_script-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
printf "[qgis_test]\nhost=localhost\ndbname=qgis_test\nuser=postgres" > ~/.pg_service.conf
psql -c 'CREATE DATABASE qgis_test;' -U postgres
psql -c 'CREATE EXTENSION postgis;' -U postgres -d qgis_test
psql -f $TRAVIS_BUILD_DIR/tests/testdata/provider/testdata.sql -U postgres -d qgis_test

5 changes: 5 additions & 0 deletions ci/travis/install-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir build
cd build
cmake -DWITH_SERVER=ON -DWITH_STAGED_PLUGINS=OFF -DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON -DENABLE_MODELTEST=ON -DENABLE_PGTEST=ON \
-DWITH_QWTPOLAR=OFF -DWITH_APIDOC=ON -DWITH_PYSPATIALITE=ON ..
8 changes: 8 additions & 0 deletions ci/travis/install-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mkdir build
cd build
#no PGTEST for OSX - can't get postgres to start with brew install
cmake -DWITH_SERVER=ON -DWITH_STAGED_PLUGINS=OFF -DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON -DENABLE_MODELTEST=ON -DENABLE_PGTEST=OFF \
-DWITH_QWTPOLAR=OFF -DWITH_APIDOC=ON -DWITH_PYSPATIALITE=ON \
-DQWT_INCLUDE_DIR=/usr/local/opt/qwt/lib/qwt.framework/Headers/ \
-DQWT_LIBRARY=/usr/local/opt/qwt/lib/qwt.framework/qwt ..
2 changes: 2 additions & 0 deletions ci/travis/script-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
xvfb-run ctest -V -E 'qgis_openstreetmaptest|qgis_wcsprovidertest' -S ./qgis-test-travis.ctest --output-on-failure

2 changes: 2 additions & 0 deletions ci/travis/script-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ctest -V -E 'qgis_openstreetmaptest|qgis_wcsprovidertest' -S ./qgis-test-travis.ctest --output-on-failure

0 comments on commit a477b3a

Please sign in to comment.