sudo: required
language: none

services:
  - docker

before_script:
  - mkdir -p ~/workspace/catkin_ws/src
  - |
    cd ~/workspace
    git clone https://github.com/frankaemika/libfranka.git
    cd libfranka
    git checkout ${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}} || git checkout develop
    git submodule update --init --recursive
  - |
    cd ~/workspace
    docker build -t worker $TRAVIS_BUILD_DIR/.ci
    ln -sf $TRAVIS_BUILD_DIR catkin_ws/src/franka_ros

script:
  - docker run
    -v $TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR
    -v ~/workspace:/workspace
    worker /bin/sh -c '
      cd /workspace/libfranka &&
      .ci/libonly.sh &&
      export CMAKE_PREFIX_PATH="/workspace/libfranka/build-libonly:$CMAKE_PREFIX_PATH" &&
      cd /workspace/catkin_ws &&
      src/franka_ros/.ci/debug.sh
    '

sudo: required
language: none

services:
  - docker

matrix:
  include:
    - env: CI_ROS=kinetic
    - env: CI_ROS=melodic

before_script:
  - mkdir -p ~/workspace/catkin_ws/src
  - |
    cd ~/workspace
    git clone https://github.com/frankaemika/libfranka.git
    cd libfranka
    git checkout ${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}} || git checkout develop
    git submodule update --init --recursive
  - |
    cd ~/workspace
    docker build -t worker -f $TRAVIS_BUILD_DIR/.ci/Dockerfile.$CI_ROS $TRAVIS_BUILD_DIR/.ci
    ln -sf $TRAVIS_BUILD_DIR catkin_ws/src/franka_ros

script:
  - docker run
    -v $TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR
    -v ~/workspace:/workspace
    worker /bin/sh -c '
      cd /workspace/libfranka &&
      .ci/libonly.sh &&
      export CMAKE_PREFIX_PATH="/workspace/libfranka/build-libonly:$CMAKE_PREFIX_PATH" &&
      cd /workspace/catkin_ws &&
      src/franka_ros/.ci/debug.sh
    '

Build on Kinetic and Melodic
Travis: Build on Kinetic and Melodic
