Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Build tests on Ubuntu Xenial/Artful/Bionic using Docker (#1043)
  • Loading branch information
jslee02 committed Mar 26, 2018
1 parent 77902c1 commit a3fc102
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Expand Up @@ -3,7 +3,7 @@ version: "{build}"

image:
- Visual Studio 2017
- Ubuntu
#- Ubuntu

platform: x64

Expand Down
27 changes: 27 additions & 0 deletions .ci/docker/ubuntu-artful
@@ -0,0 +1,27 @@
FROM ubuntu:artful

RUN apt-get update -qq
RUN apt-get install -y \
sudo \
build-essential \
cmake \
pkg-config \
libassimp-dev \
libboost-all-dev \
libccd-dev \
libeigen3-dev \
libfcl-dev \
freeglut3-dev \
libxi-dev \
libxmu-dev \
libbullet-dev \
libode-dev \
libflann-dev \
libnlopt-dev \
coinor-libipopt-dev \
libtinyxml2-dev \
liburdfdom-dev \
liburdfdom-headers-dev \
libopenscenegraph-dev \
clang-format-3.8 \
lcov
27 changes: 27 additions & 0 deletions .ci/docker/ubuntu-bionic
@@ -0,0 +1,27 @@
FROM ubuntu:bionic

RUN apt-get update -qq
RUN apt-get install -y \
sudo \
build-essential \
cmake \
pkg-config \
libassimp-dev \
libboost-all-dev \
libccd-dev \
libeigen3-dev \
libfcl-dev \
freeglut3-dev \
libxi-dev \
libxmu-dev \
libbullet-dev \
libode-dev \
libflann-dev \
libnlopt-dev \
coinor-libipopt-dev \
libtinyxml2-dev \
liburdfdom-dev \
liburdfdom-headers-dev \
libopenscenegraph-dev \
clang-format-3.8 \
lcov
28 changes: 28 additions & 0 deletions .ci/docker/ubuntu-xenial
@@ -0,0 +1,28 @@
FROM ubuntu:xenial

RUN apt-get update -qq
RUN apt-get install -y \
sudo \
build-essential \
cmake \
pkg-config \
libassimp-dev \
libboost-all-dev \
libccd-dev \
libeigen3-dev \
libfcl-dev \
freeglut3-dev \
libxi-dev \
libxmu-dev \
libbullet-dev \
libode-dev \
libflann-dev \
libnlopt-dev \
coinor-libipopt-dev \
libtinyxml2-dev \
liburdfdom-dev \
liburdfdom-headers-dev \
libopenscenegraph-dev \
clang-format-3.8 \
lcov \
curl
8 changes: 8 additions & 0 deletions .ci/env.list
@@ -0,0 +1,8 @@
TRAVIS_PULL_REQUEST
TRAVIS_OS_NAME
TRAVIS_BUILD_DIR

COMPILER
BUILD_TYPE
CODECOV
SUDO
7 changes: 7 additions & 0 deletions .ci/install.sh
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -ex

if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$COMPILER" = "CLANG" ]; then exit; fi

if [ "$TRAVIS_OS_NAME" = "linux" ]; then '.ci/install_linux.sh' ; fi
if [ "$TRAVIS_OS_NAME" = "osx" ]; then '.ci/install_osx.sh' ; fi
3 changes: 1 addition & 2 deletions ci/install_linux.sh → .ci/install_linux.sh
@@ -1,6 +1,5 @@
#!/usr/bin/env bash

set -e
set -ex

sudo apt-add-repository --yes ppa:libccd-debs/ppa
sudo apt-add-repository --yes ppa:fcl-debs/ppa
Expand Down
3 changes: 1 addition & 2 deletions ci/install_osx.sh → .ci/install_osx.sh
@@ -1,6 +1,5 @@
#!/usr/bin/env bash

set -e
set -ex

brew update > /dev/null
brew bundle
7 changes: 3 additions & 4 deletions ci/script.sh → .ci/script.sh
@@ -1,17 +1,16 @@
#!/usr/bin/env bash

set -e
set -xe

if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$COMPILER" = "CLANG" ]; then exit; fi

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDART_VERBOSE=ON -DDART_TREAT_WARNINGS_AS_ERRORS=ON -DDART_CODECOV=$CODECOV ..
if [ "$TRAVIS_OS_NAME" = "linux" ]; then make -j4 tutorials examples tests; else make -j4 tests; fi
if [ "$TRAVIS_OS_NAME" = "linux" ]; then make check-format; fi
if [ $CODECOV = ON ]; then make -j4 codecov; else make -j4 test; fi
if [ $CODECOV = ON ]; then make -j4 codecov; else ctest --output-on-failure -j4; fi

# Make sure we can install with no issues
sudo make -j4 install
$SUDO make -j4 install

# Build an example using installed DART
cd $TRAVIS_BUILD_DIR/examples/rigidCubes
Expand Down
30 changes: 24 additions & 6 deletions .travis.yml
Expand Up @@ -11,16 +11,25 @@ matrix:
include:
- os: linux
compiler: gcc
env: BUILD_TYPE=Debug CODECOV=ON COMPILER=GCC
env: SUDO=sudo BUILD_TYPE=Debug CODECOV=ON COMPILER=GCC
- os: linux
compiler: gcc
env: BUILD_TYPE=Release CODECOV=OFF COMPILER=GCC
env: SUDO=sudo BUILD_TYPE=Release CODECOV=OFF COMPILER=GCC
- os: linux
compiler: clang
env: BUILD_TYPE=Debug CODECOV=OFF COMPILER=CLANG
env: SUDO=sudo BUILD_TYPE=Debug CODECOV=OFF COMPILER=CLANG
- os: linux
compiler: clang
env: BUILD_TYPE=Release CODECOV=OFF COMPILER=CLANG
env: SUDO=sudo BUILD_TYPE=Release CODECOV=OFF COMPILER=CLANG
- os: linux
env: DOCKER_FILE="ubuntu-xenial" BUILD_TYPE=Release CODECOV=OFF COMPILER=GCC
services: docker
- os: linux
env: DOCKER_FILE="ubuntu-artful" BUILD_TYPE=Release CODECOV=OFF COMPILER=GCC
services: docker
- os: linux
env: DOCKER_FILE="ubuntu-bionic" BUILD_TYPE=Release CODECOV=OFF COMPILER=GCC
services: docker
- os: osx
osx_image: xcode9.3beta
compiler: clang
Expand All @@ -31,10 +40,19 @@ matrix:
env: BUILD_TYPE=Release CODECOV=OFF COMPILER=CLANG

install:
- 'ci/install.sh'
- if [ -n "$DOCKER_FILE" ]; then
docker build -t "$DOCKER_FILE" -f ".ci/docker/$DOCKER_FILE" .;
docker run -itd -v $TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR --env-file .ci/env.list --name dart-docker "$DOCKER_FILE";
else
'.ci/install.sh';
fi

script:
- 'ci/script.sh'
- if [ -n "$DOCKER_FILE" ]; then
docker exec dart-docker /bin/sh -c "cd $TRAVIS_BUILD_DIR && ./.ci/script.sh";
else
'.ci/script.sh';
fi

after_success:
- if [ $CODECOV = ON ]; then bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"; fi
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -47,6 +47,10 @@

### [DART 6.3.1 (2018-03-14)](https://github.com/dartsim/dart/milestone/42?closed=1)

* Build system

* Remove an undefined cmake macro/function: [#1036](https://github.com/dartsim/dart/pull/1036)

* ROS support

* Tweaked package.xml for catkin support: [#1027](https://github.com/dartsim/dart/pull/1027), [#1029](https://github.com/dartsim/dart/pull/1029), [#1031](https://github.com/dartsim/dart/pull/1031), [#1032](https://github.com/dartsim/dart/pull/1031), [#1033](https://github.com/dartsim/dart/pull/1033)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -127,7 +127,7 @@ elseif("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "RELWITHDEBINFO")
elseif("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "MINSIZEREL")
set(BUILD_TYPE_MINSIZEREL TRUE)
else()
build_error("CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} unknown. Valid options are: Debug | Release | RelWithDebInfo | MinSizeRel")
message(STATUS "CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} unknown. Valid options are: Debug | Release | RelWithDebInfo | MinSizeRel")
endif()

#===============================================================================
Expand Down
8 changes: 0 additions & 8 deletions ci/install.sh

This file was deleted.

0 comments on commit a3fc102

Please sign in to comment.