From 4e7bc293e76c6003923fd83bb53b1c02ba5d7bbc Mon Sep 17 00:00:00 2001 From: Greg Harrison Date: Fri, 17 Mar 2017 15:01:18 -0400 Subject: [PATCH] Initial working version of mac and linux travis build. --- .travis.yml | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..69a5fc2251 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,74 @@ +language: cpp +#git: +# shorten this if we can nail down submodule depth +# depth: 3 + +fast_finish: false + +matrix: + allow_failures: + - os: osx + - os: linux + + include: + # linux version have unique dependencies, so we set them up individually + - os: linux + dist: trusty + sudo: required + services: + - docker + + # OS X CMake + - os: osx + sudo: required + osx_image: xcode8.2 + compiler: + - clang + env: + - TOOL="cmake" + - DESCRIPTION="OS X build/test via CMake" + - EIGEN_ROOT="/usr/local/Cellar/eigen/3.3.3" + - EIGEN3_INCLUDE_DIR="/usr/local/Cellar/eigen/3.3.3/include/eigen3" + +# docker exec xenial apt-get -y install clang libclang-3.8-dev; +install: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + docker pull ubuntu:xenial; + docker run -d --name xenial -dti ubuntu:xenial bash; + docker ps -a; + docker exec xenial mkdir /build; + docker cp . xenial:/build; + docker exec xenial apt-get update; + docker exec xenial apt-get -y upgrade; + docker exec xenial apt-get -y install git wget unzip; + docker exec xenial apt-get -y install build-essential software-properties-common cmake; + docker exec xenial wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -; + docker exec xenial apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main"; + docker exec xenial apt-get update; + docker exec xenial apt-get -y --allow-unauthenticated install clang-3.9 lldb-3.9; + docker exec xenial update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 60 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-3.9; + docker exec xenial wget https://launchpad.net/ubuntu/+source/libc++/3.9.1-2/+build/11842034/+files/libc++-dev_3.9.1-2_amd64.deb; + docker exec xenial wget https://launchpad.net/ubuntu/+source/libc++/3.9.1-2/+build/11842034/+files/libc++-helpers_3.9.1-2_all.deb; + docker exec xenial wget https://launchpad.net/ubuntu/+source/libc++/3.9.1-2/+build/11842034/+files/libc++1_3.9.1-2_amd64.deb; + docker exec xenial wget https://launchpad.net/ubuntu/+source/libc++/3.9.1-2/+build/11842034/+files/libc++abi-dev_3.9.1-2_amd64.deb; + docker exec xenial wget https://launchpad.net/ubuntu/+source/libc++/3.9.1-2/+build/11842034/+files/libc++abi1_3.9.1-2_amd64.deb; + docker exec xenial dpkg -i libc++1_3.9.1-2_amd64.deb libc++abi1_3.9.1-2_amd64.deb libc++-dev_3.9.1-2_amd64.deb libc++-helpers_3.9.1-2_all.deb; + elif [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TOOL" == "cmake" ]]; then + echo "No install osx actions--using repo eigen"; + fi + +before_install: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + echo "No pre-install linux actions--using docker"; + elif [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TOOL" == "cmake" ]]; then + echo "No pre-install osx actions"; + fi + +#docker exec xenial /bin/sh -c "export EIGEN3_INCLUDE_DIR=/build/eigen/eigen3 && cd /build/cmake && sh ./build.sh && cmake . && make"; +script: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + docker exec -t --privileged xenial /build/build.sh; + elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + git submodule update --init --recursive; + ./build.sh; + fi