Skip to content

Commit

Permalink
Travis CI: use a build matrix for the various environments + use ccache
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/gdal/trunk@36078 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
rouault committed Nov 2, 2016
1 parent c2005bf commit 8aa60fc
Show file tree
Hide file tree
Showing 38 changed files with 1,238 additions and 148 deletions.
281 changes: 144 additions & 137 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,149 +1,156 @@
# This is the config file for building GDAL and running its autotest suite
# with Travis-ci.org

language: cpp

# We use clang, --without-libtool and --with-debug for faster build
compiler:
- clang
matrix:
fast_finish: true
include:
- os: linux
compiler: clang
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=precise_clang
- DETAILS="debug build, no libtool"
- os: linux
compiler: clang
language: cpp
sudo: required
dist: trusty
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=trusty_clang
- DETAILS="optimized build, no libtool"
- os: linux
compiler: clang
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=mingw
- DETAILS="debug build, libtool"
- os: linux
compiler: clang
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=mingw_w64
- DETAILS="optimized build, libtool"
- os: linux
compiler: gcc
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=python3
- DETAILS=""
- os: linux
compiler: gcc
language: cpp
sudo: false
cache:
apt: true
directories:
- $HOME/.ccache
apt:
packages:
- ccache
env:
- BUILD_NAME=android
- DETAILS=""
- os: linux
compiler: gcc
language: cpp
sudo: false
cache:
apt: true
directories:
- $HOME/.ccache
apt:
packages:
- ccache
env:
- BUILD_NAME=big_endian
- DETAILS=""
- os: linux
compiler: gcc
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=gcc48_stdcpp11
- DETAILS=""
- os: linux
compiler: gcc
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=gcc52_stdcpp14_sanitize
- DETAILS=""
- os: linux
compiler: gcc
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=ubuntu_1604
- DETAILS=""
- os: linux
compiler: gcc
language: cpp
sudo: required
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=precise_32bit
- DETAILS=""
- osx_image: xcode8
language: objective-c
compiler: clang
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=osx
- DETAILS="debug build, libtool"

before_install:
- sudo mv /etc/apt/sources.list.d/pgdg* /tmp
- sudo apt-get remove postgis libpq5 libpq-dev postgresql-9.1-postgis postgresql-9.1-postgis-2.2-scripts postgresql-9.2-postgis postgresql-9.3-postgis postgresql-9.1 postgresql-9.2 postgresql-9.3 libgdal1
- sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
- sudo add-apt-repository -y ppa:marlam/gta
- sudo apt-get update -qq
- sudo apt-get install python-numpy postgis postgresql-9.1 postgresql-client-9.1 postgresql-9.1-postgis-2.1 postgresql-9.1-postgis-2.1-scripts libpq-dev libpng12-dev libjpeg-dev libgif-dev liblzma-dev libgeos-dev libcurl4-gnutls-dev libproj-dev libxml2-dev libexpat-dev libxerces-c-dev libnetcdf-dev netcdf-bin libpoppler-dev libspatialite-dev gpsbabel swig libhdf4-alt-dev libhdf5-serial-dev libpodofo-dev poppler-utils libfreexl-dev unixodbc-dev libwebp-dev openjdk-7-jdk libepsilon-dev libgta-dev liblcms2-2 libpcre3-dev mercurial cmake libcrypto++-dev
- sudo apt-get install python-lxml
- sudo apt-get install python-pip
- sudo apt-get install libogdi3.2-dev
# Boost for Mongo
- sudo apt-get install libboost-regex-dev libboost-system-dev libboost-thread-dev
- sudo pip install pyflakes
- sudo apt-get install doxygen texlive-latex-base
- pyflakes autotest
- pyflakes gdal/swig/python/scripts
- pyflakes gdal/swig/python/samples
- psql -c "drop database if exists autotest" -U postgres
- psql -c "create database autotest" -U postgres
- psql -c "create extension postgis" -d autotest -U postgres
- mysql -e "create database autotest;"
- mysql -e "GRANT ALL ON autotest.* TO 'root'@'localhost';" -u root
- mysql -e "GRANT ALL ON autotest.* TO 'travis'@'localhost';" -u root
- wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/FileGDB_API_1_2-64.tar.gz
- wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44.tar.gz
- wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/install-libecwj2-ubuntu12.04-64bit.tar.gz
- wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/install-libkml-r864-64bit.tar.gz
- wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/install-openjpeg-2.0.0-ubuntu12.04-64bit.tar.gz
- wget http://even.rouault.free.fr/mongo-cxx-1.0.2-install-ubuntu12.04-64bit.tar.gz
- tar xzf MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44.tar.gz
- sudo cp -r MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44/Raster_DSDK/include/* /usr/local/include
- sudo cp -r MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44/Raster_DSDK/lib/* /usr/local/lib
- sudo cp -r MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44/Lidar_DSDK/include/* /usr/local/include
- sudo cp -r MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44/Lidar_DSDK/lib/* /usr/local/lib
- tar xzf FileGDB_API_1_2-64.tar.gz
- sudo cp -r FileGDB_API/include/* /usr/local/include
- sudo cp -r FileGDB_API/lib/* /usr/local/lib
- tar xzf install-libecwj2-ubuntu12.04-64bit.tar.gz
- sudo cp -r install-libecwj2/include/* /usr/local/include
- sudo cp -r install-libecwj2/lib/* /usr/local/lib
- tar xzf install-libkml-r864-64bit.tar.gz
- sudo cp -r install-libkml/include/* /usr/local/include
- sudo cp -r install-libkml/lib/* /usr/local/lib
- tar xzf install-openjpeg-2.0.0-ubuntu12.04-64bit.tar.gz
- sudo cp -r install-openjpeg/include/* /usr/local/include
- sudo cp -r install-openjpeg/lib/* /usr/local/lib
- tar xzf mongo-cxx-1.0.2-install-ubuntu12.04-64bit.tar.gz
- sudo cp -r mongo-cxx-1.0.2-install/include/* /usr/local/include
- sudo cp -r mongo-cxx-1.0.2-install/lib/* /usr/local/lib
- wget https://bitbucket.org/chchrsc/kealib/get/c6d36f3db5e4.zip
- unzip c6d36f3db5e4.zip
- cd chchrsc-kealib-c6d36f3db5e4/trunk
- cmake . -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DHDF5_INCLUDE_DIR=/usr/include -DHDF5_LIB_PATH=/usr/lib -DLIBKEA_WITH_GDAL=OFF
- make -j4
- sudo make install
- cd ../..
- sudo ldconfig

# installing PostGIS 2 from Ubuntu PPA draws libgdal1.9 dependency. We must install ourselves
# in /usr too to avoid gdal version conflict. Might be fragile however
- ./gdal/ci/travis/${BUILD_NAME}/before_install.sh

install:
- cd gdal
- ./configure --prefix=/usr --without-libtool --enable-debug --with-jpeg12 --with-python --with-poppler --with-podofo --with-spatialite --with-mysql --with-liblzma --with-webp --with-java --with-mdb --with-jvm-lib-add-rpath --with-epsilon --with-gta --with-ecw=/usr/local --with-mrsid=/usr/local --with-mrsid-lidar=/usr/local --with-fgdb=/usr/local --with-libkml --with-openjpeg=/usr/local --with-mongocxx=/usr/local
- make docs >docs_log.txt 2>&1
- if cat docs_log.txt | grep -i warning | grep -v russian | grep -v brazilian; then echo "Doxygen warnings found" && cat docs_log.txt && /bin/false; else echo "No Doxygen warnings found"; fi
- make man >man_log.txt 2>&1
- if cat man_log.txt | grep -i warning; then echo "Doxygen warnings found" && cat docs_log.txt && /bin/false; else echo "No Doxygen warnings found"; fi
- make USER_DEFS="-Wextra -Werror" -j3
- cd apps
- make USER_DEFS="-Wextra -Werror" test_ogrsf
- cd ..
- cd swig/java
- cat java.opt | sed "s/JAVA_HOME =.*/JAVA_HOME = \/usr\/lib\/jvm\/java-7-openjdk-amd64\//" > java.opt.tmp
- mv java.opt.tmp java.opt
- make
- cd ../..
- cd swig/perl
- make generate
- make
- cd ../..
- sudo rm -f /usr/lib/libgdal.so*
- sudo make install
- sudo ldconfig
- cd ../autotest/cpp
- make -j3
- cd ../../gdal
- wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mdb-sqlite/mdb-sqlite-1.0.2.tar.bz2
- tar xjvf mdb-sqlite-1.0.2.tar.bz2
- sudo cp mdb-sqlite-1.0.2/lib/*.jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext
- ./gdal/ci/travis/${BUILD_NAME}/install.sh

# When run in the same process after ogr_pgeo.py (with the MDB driver), FileGDB tests fail.
# Run it in isolation
script:
# Perl unit tests
- cd swig/perl
- make test
- cd ../..
# Java unit tests
- cd swig/java
- make test
- cd ../..
# CPP unit tests
- cd ../autotest
- cd cpp
- GDAL_SKIP=JP2ECW make quick_test
# Compile and test vsipreload
- make vsipreload.so
- LD_PRELOAD=./vsipreload.so gdalinfo /vsicurl/http://download.osgeo.org/gdal/data/ecw/spif83.ecw
- LD_PRELOAD=./vsipreload.so sqlite3 /vsicurl/http://download.osgeo.org/gdal/data/sqlite3/polygon.db "select * from polygon limit 10"
- cd ..
# Download a sample file
- mkdir -p ogr/tmp/cache/
- cd ogr/tmp/cache/
- wget http://download.osgeo.org/gdal/data/pgeo/PGeoTest.zip
- unzip PGeoTest.zip
- cd ../../..
# Run ogr_fgdb.py in isolation from the rest
- cd ogr
- python ogr_fgdb.py
- mkdir disabled
- mv ogr_fgdb.* disabled
- cd ..
# Run ogr_pgeo.py in isolation from the rest
- cd ogr
- python ogr_pgeo.py
- mv ogr_pgeo.* disabled
- cd ..
# Run all the Python autotests
- GDAL_SKIP="JP2ECW ECW" python run_all.py
# A bit messy, but force testing with libspatialite 4.0dev (that has been patched a bit to remove any hard-coded SRS definition so it is very small)
- cd ogr
- wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/libspatialite4.0dev_ubuntu12.04-64bit_srs_stripped.tar.gz
- tar xzf libspatialite4.0dev_ubuntu12.04-64bit_srs_stripped.tar.gz
- ln -s install-libspatialite-4.0dev/lib/libspatialite.so.5.0.1 libspatialite.so.3
- LD_LIBRARY_PATH=$PWD python ogr_sqlite.py
- cd ..
- ./gdal/ci/travis/${BUILD_NAME}/script.sh

notifications:
email:
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ GDAL - Geospatial Data Abstraction Library

| Environment | Status |
| ------------------------ |:-------------:|
| Ubuntu 12.04 64 bit | [![Build Status](https://travis-ci.org/OSGeo/gdal.svg?branch=trunk)](https://travis-ci.org/OSGeo/gdal) |
| Ubuntu 12.04 32 bit | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_32bit)](https://travis-ci.org/rouault/gdal_coverage) |
| Ubuntu 14.04 64 bit | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_trusty)](https://travis-ci.org/rouault/gdal_coverage) |
| Ubuntu 16.04 64 / CL 3.9 | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_ubuntu16_04)](https://travis-ci.org/rouault/gdal_coverage) |
| Python 3 | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=python3)](https://travis-ci.org/rouault/gdal_coverage) |
| MacOS X | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_travis_macosx)](https://travis-ci.org/rouault/gdal_coverage) |
| Ubuntu 12.04 64 bit | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=precise_clang&label=precise_clang)](https://travis-ci.org/OSGeo/gdal) |
| Ubuntu 12.04 32 bit | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=precise_32bit&label=precise_32bit)](https://travis-ci.org/OSGeo/gdal) |
| Ubuntu 14.04 64 bit | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=trusty_clang&label=trusty_clang)](https://travis-ci.org/OSGeo/gdal) |
| Ubuntu 16.04 64 / CL 3.9 | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=ubuntu_1604&label=ubuntu_1604)](https://travis-ci.org/OSGeo/gdal) |
| Python 3 | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=python3&label=python3)](https://travis-ci.org/OSGeo/gdal) |
| MacOS X | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=osx&label=osx)](https://travis-ci.org/OSGeo/gdal) |
| MSVC 2008 | [![Build status](https://ci.appveyor.com/api/projects/status/tbtcdve977yd5atp/branch/trunk_vc9?svg=true)](https://ci.appveyor.com/project/rouault/gdal-coverage) |
| MSVC 2013 32 & 64 bit | [![Build status](https://ci.appveyor.com/api/projects/status/tbtcdve977yd5atp/branch/trunk_vc12_full?svg=true)](https://ci.appveyor.com/project/rouault/gdal-coverage) |
| MSVC 2015 32 & 64 bit | [![Build status](https://ci.appveyor.com/api/projects/status/tbtcdve977yd5atp/branch/trunk_vc13?svg=true)](https://ci.appveyor.com/project/rouault/gdal-coverage) |
| MinGW | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_mingw)](https://travis-ci.org/rouault/gdal_coverage) |
| MinGW_W64 | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_mingw_w64)](https://travis-ci.org/rouault/gdal_coverage) |
| Android | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_android)](https://travis-ci.org/rouault/gdal_coverage) |
| GCC 4.8 C++11 | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_gcc4.8_stdc11)](https://travis-ci.org/rouault/gdal_coverage) |
| GCC 5.2 C++14 -fsanitize | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_gcc5.2_sanitize)](https://travis-ci.org/rouault/gdal_coverage) |
| MinGW | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=mingw&label=mingw)](https://travis-ci.org/OSGeo/gdal) |
| MinGW_W64 | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=mingw_w64&label=mingw_w64)](https://travis-ci.org/OSGeo/gdal) |
| Android | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=android&label=android)](https://travis-ci.org/OSGeo/gdal) |
| Big endian host | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=big_endian&label=big_endian)](https://travis-ci.org/OSGeo/gdal) |
| GCC 4.8 C++11 | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=gcc48_stdcpp11&label=gcc48_stdcpp11)](https://travis-ci.org/OSGeo/gdal) |
| GCC 5.2 C++14 -fsanitize | [![Build Status](http://badges.herokuapp.com/travis/OSGeo/gdal?branch=trunk&env=BUILD_NAME=gcc52_stdcpp14_sanitize&label=gcc52_stdcpp14_sanitize)](https://travis-ci.org/OSGeo/gdal) |
| Clang Static Analyzer | [![Build Status](https://travis-ci.org/rouault/gdal_coverage.svg?branch=trunk_clang_static_analyzer)](https://travis-ci.org/rouault/gdal_coverage) |
| Coverity Scan | [![Build Status](https://scan.coverity.com/projects/749/badge.svg?flat=1)](https://scan.coverity.com/projects/gdal) |

Expand Down
7 changes: 7 additions & 0 deletions gdal/ci/travis/android/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2
tar xjf android-ndk-r9d-linux-x86_64.tar.bz2
android-ndk-r9d/build/tools/make-standalone-toolchain.sh --platform=android-8 --install-dir=$HOME/android-8-toolchain
13 changes: 13 additions & 0 deletions gdal/ci/travis/android/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e

export CCACHE_CPP2=yes

unset CC
unset CXX
export PATH=$HOME/android-8-toolchain/bin:$PATH

cd gdal
CC="ccache arm-linux-androideabi-gcc" CXX="ccache arm-linux-androideabi-g++" CFLAGS="-mthumb" CXXFLAGS="-mthumb" LIBS="-lsupc++ -lstdc++" ./configure --host=arm-linux-androideabi
make USER_DEFS="-Wextra -Werror" -j3
5 changes: 5 additions & 0 deletions gdal/ci/travis/android/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

echo "finished"
6 changes: 6 additions & 0 deletions gdal/ci/travis/big_endian/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

set -e

wget https://releases.linaro.org/components/toolchain/binaries/5.1-2015.08/armeb-linux-gnueabihf/gcc-linaro-5.1-2015.08-x86_64_armeb-linux-gnueabihf.tar.xz
tar xJf gcc-linaro-5.1-2015.08-x86_64_armeb-linux-gnueabihf.tar.xz
14 changes: 14 additions & 0 deletions gdal/ci/travis/big_endian/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

export PATH=$PWD/gcc-linaro-5.1-2015.08-x86_64_armeb-linux-gnueabihf/bin:$PATH
unset CC
unset CXX

cd gdal
export CCACHE_CPP2=yes
CC="ccache armeb-linux-gnueabihf-gcc" CXX="ccache armeb-linux-gnueabihf-g++" ./configure --host=armeb-linux-gnueabihf --without-libtool
make USER_DEFS="-Werror" -j3
cd apps
make USER_DEFS="-Werror" test_ogrsf
5 changes: 5 additions & 0 deletions gdal/ci/travis/big_endian/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

echo "finished"
Loading

0 comments on commit 8aa60fc

Please sign in to comment.