Permalink
Browse files

Use docker for travis

so we can run on more modern distros of Ubuntu, including modern CMake
  • Loading branch information...
jlblancoc committed Dec 6, 2017
1 parent 08299ac commit 751c65e03521376ad5dcdd1df60447a71f536e4b
Showing with 51 additions and 63 deletions.
  1. +16 −59 .travis.yml
  2. +1 −1 CMakeLists.txt
  3. +1 −1 README.md
  4. +33 −2 travis/travis_main.sh
View
@@ -1,53 +1,16 @@
# Use docker to test on a more modern Ubuntu distro
language: cpp
cache: ccache
sudo: required
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:v-launchpad-jochen-sprickerhof-de/pcl'
packages:
- g++-6
- clang-3.8
- build-essential
- pkg-config
- cmake
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew tap homebrew/science ;
brew install eigen ;
/usr/bin/yes | pip uninstall numpy ;
brew install opencv ;
brew install assimp ;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$CXX" == "g++" ]; then export CXX="g++-6"; fi
if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.8"; fi
if [ "$TASK" == "lint" ]; then pip install -r travis/python_reqs.txt; fi
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$DEPS" != "minimal" ]; then
sudo apt-get install libftdi-dev zlib1g-dev libusb-1.0-0-dev libdc1394-22-dev -y ;
sudo apt-get install libjpeg-dev libopencv-dev libgtest-dev libeigen3-dev -y ;
sudo apt-get install libsuitesparse-dev libpcl-all libopenni2-dev libudev-dev -y ;
sudo apt-get install libboost-python-dev libpython-dev python-numpy -y ;
if [ "$DEPS" != "headless" ]; then
sudo apt-get install libwxgtk3.0-dev -y ;
sudo apt-get install freeglut3-dev -y ;
sudo apt-get install libavformat-dev libswscale-dev -y ;
sudo apt-get install libassimp-dev -y ;
sudo apt-get install qtbase5-dev libqt5opengl5-dev -y ;
fi
fi
before_script:
- export DOCKER_IMAGE=ubuntu:$DISTRO
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
- docker images
script:
- bash travis/check_style.sh
- bash travis/travis_main.sh
- docker run -v $HOME:$HOME -e MAKEFLAGS -e CCACHE_SLOPPINESS -e TASK -e DEPS -e CI_SOURCE_PATH -e REPOSITORY_NAME -e HOME -e DISTRO -e CI_ROS_DISTRO $DOCKER_IMAGE bash -c 'cd $CI_SOURCE_PATH; apt-get update -qq ; source travis/check_style.sh; source travis/travis_main.sh'
env:
global:
@@ -58,34 +21,28 @@ matrix:
include:
- compiler: gcc
os: linux
env: TASK="build"
env: TASK="build" DISTRO=xenial
- compiler: gcc
os: linux
env: TASK="test"
env: TASK="test" DISTRO=xenial
- compiler: gcc
os: linux
env: TASK="build" DEPS="headless"
env: TASK="build" DEPS="headless" DISTRO=xenial
- compiler: gcc
os: linux
env: TASK="test" DEPS="headless"
env: TASK="test" DEPS="headless" DISTRO=xenial
- compiler: gcc
os: linux
env: TASK="build" DEPS="minimal"
env: TASK="build" DEPS="minimal" DISTRO=xenial
- compiler: gcc
os: linux
env: TASK="test" DEPS="minimal"
env: TASK="test" DEPS="minimal" DISTRO=xenial
- compiler: clang
os: linux
env: TASK="build"
env: TASK="build" DISTRO=xenial
- compiler: clang
os: linux
env: TASK="test"
- compiler: gcc
os: osx
env: TASK="test"
- compiler: clang
os: osx
env: TASK="test"
env: TASK="test" DISTRO=xenial
- language: python
os: linux
env: TASK="lint"
env: TASK="lint" DISTRO=xenial
View
@@ -21,7 +21,7 @@ PROJECT(MRPT LANGUAGES C CXX)
if (WIN32)
CMAKE_MINIMUM_REQUIRED(VERSION 3.4) # required for CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
else()
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
CMAKE_MINIMUM_REQUIRED(VERSION 3.3)
endif()
set (CMAKE_CXX_STANDARD 14) # Require C++14
View
@@ -53,7 +53,7 @@ Minimum compiler requisites:
* mrpt >=2.0 (`master` branch):
* Ubuntu 16.04LTS Xenial: default gcc/clang versions
* Windows: Visual Studio 2015/2017.
* cmake >= 3.1 required (>=3.4 for Windows).
* cmake >= 3.3 required (>=3.4 for Windows).
* mrpt 1.5.* and maintenance `mrpt-1.5` branch:
* Ubuntu 14.04LTS Trusty: default gcc/clang versions
* Windows: Visual Studio 2012
View
@@ -1,5 +1,4 @@
#!/bin/bash
set -e # Make sure any error makes the script to return an error code
MRPT_DIR=`pwd`
@@ -9,6 +8,36 @@ CMAKE_C_FLAGS="-Wall -Wextra -Wabi -O2"
CMAKE_CXX_FLAGS="-Wall -Wextra -Wabi -O2"
EXTRA_CMAKE_ARGS="-DDISABLE_PCL=ON" # PCL causes link errors (?!)
function prepare_install()
{
apt-get install build-essential software-properties-common gcc g++ clang pkg-config cmake python-pip -y
apt-get install git-core -y
apt-get install ccache -y
if [ "$TASK" == "lint" ]; then
pip install -r travis/python_reqs.txt
fi
if [ "$DEPS" != "minimal" ]; then
apt-get install libftdi-dev zlib1g-dev libusb-1.0-0-dev libdc1394-22-dev -y
apt-get install libjpeg-dev libopencv-dev libgtest-dev libeigen3-dev -y
apt-get install libsuitesparse-dev libopenni2-dev libudev-dev -y
apt-get install libboost-python-dev libpython-dev python-numpy -y
# We must use a custom PPA to solve errors in PCL official pkgs
add-apt-repository ppa:jolting/backport-mrpt
apt-get update -qq
apt-get install libpcl-dev -y
if [ "$DEPS" != "headless" ]; then
apt-get install libwxgtk3.0-dev -y
apt-get install freeglut3-dev -y
apt-get install libavformat-dev libswscale-dev -y
apt-get install libassimp-dev -y
apt-get install qtbase5-dev libqt5opengl5-dev -y
fi
fi
}
function prepare_build_dir()
{
# Make sure we dont have spurious files:
@@ -57,7 +86,7 @@ function test ()
{
# gcc is too slow and we have a time limit in Travis CI:
if [ "$CC" == "gcc" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then
return
return
fi
prepare_build_dir
@@ -77,6 +106,8 @@ function test ()
cd $MRPT_DIR
}
prepare_install
case $TASK in
build ) build;;
test ) test;;

0 comments on commit 751c65e

Please sign in to comment.