Skip to content

Commit

Permalink
[travis] Add initial travis support.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-moulard committed Aug 28, 2013
1 parent cff05a7 commit 88eff85
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .travis.build.sh
@@ -0,0 +1,70 @@
#!/bin/sh
set -e

# Directories.
root_dir=`pwd`
build_dir="$root_dir/_travis/build"
install_dir="$root_dir/_travis/install"
core_dir="$build_dir/roboptim-core"

# Shortcuts.
git_clone="git clone --quiet --recursive"

# Create layout.
rm -rf "$build_dir" "$install_dir"
mkdir -p "$build_dir"
mkdir -p "$install_dir"

# Setup environment variables.
export LD_LIBRARY_PATH="$install_dir/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$install_dir/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH):$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$install_dir/lib/roboptim-core:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$install_dir/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)/roboptim-core:$LD_LIBRARY_PATH"

export PKG_CONFIG_PATH="$install_dir/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="$install_dir/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)/pkgconfig:$PKG_CONFIG_PATH"

# Print paths for debugging
echo "Printing environment variables..."
env

# Checkout Eigen.
cd "$build_dir"
wget "http://bitbucket.org/eigen/eigen/get/3.2.0.tar.gz"
tar xzvf 3.2.0.tar.gz
cd "$build_dir/eigen-eigen-ffa86ffb5570/"
mkdir -p "$build_dir/eigen-eigen-ffa86ffb5570/_build"
cd "$build_dir/eigen-eigen-ffa86ffb5570/_build"
cmake .. -DCMAKE_INSTALL_PREFIX:STRING="$install_dir" \
-Dpkg_config_libdir:STRING="$install_dir/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)"
make
make install

# Checkout NAG.
cd "$build_dir"
wget "http://www.nag.co.uk/downloads/impl/cll6a23dhl.tgz"
tar xzvf cll6a23dhl.tgz
cd "$build_dir/cll6a23dhl"
./install.sh -accept -installdir="$install_dir/NAG"

# Checkout roboptim-core
echo "Installing dependencies..."
cd "$build_dir"
$git_clone "git://github.com/roboptim/roboptim-core.git"
cd "$core_dir"
cmake . -DCMAKE_INSTALL_PREFIX:STRING="$install_dir"
make install

# Build package
echo "Building package..."
cd "$build_dir"
cmake "$root_dir" -DCMAKE_INSTALL_PREFIX="$install_dir" \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_MODULE_LINKER_FLAGS="--coverage" \
-DNAG_DIR="$install_dir/NAG/cll6a23dhl"
make
make install
# Print error logs when tests fail
export CTEST_OUTPUT_ON_FAILURE=1
make test
30 changes: 30 additions & 0 deletions .travis.yml
@@ -0,0 +1,30 @@
language: cpp
compiler:
- clang
- gcc
script: "./.travis.build.sh"
before_install:
- git submodule update --init --recursive
- sudo apt-get update -qq
- sudo apt-get install -qq doxygen doxygen-latex libltdl-dev libboost-all-dev liblog4cxx10-dev
- sudo pip install cpp-coveralls --use-mirrors
after_success:
- coveralls -e _travis/install -e _travis/build/eigen-eigen-ffa86ffb5570/ -e _travis/build/roboptim-core/ -e tests
- git config --global user.name "Travis CI"
- git config --global user.email "thomas.moulard+travis@gmail.com"
- git remote set-url origin https://thomas-moulard:${GH_TOKEN}@github.com/roboptim/roboptim-core-plugin-ipopt.git
- git fetch origin gh-pages:gh-pages
- cd _travis/build/doc && ../../../cmake/github/update-doxygen-doc.sh
after_failure: "cat `pwd`/_travis/build/tests/*.log"
notifications:
email:
- roboptim@googlegroups.com
branches:
only:
- master
matrix:
allow_failures:
- compiler: clang
env:
global:
secure: "Slm+HqRT+Vy0SG7E9gEShuHvNz6XWRUmBhVBLVJEaYy/0Lo2qp4OjFEWDjiJwFIiXstW2Wclds4SuewAn3Tc4x7dsY+5uaMCX7S/HPzsBCjLXUwjKasUqEGaVTIYmtFJm57hOkz6K2SLUUV4intkMiwtCiq/R0xe92QTTKkHyfo="

0 comments on commit 88eff85

Please sign in to comment.