language: cpp
git:
  depth: false
compiler:
  - gcc
# - clang
env:
  global:
    - secure: "SnIBG/xLIHX3CSvUbqqsX8xTVqIqQ7fFS6HWO6KZQVBsT6yugTwYHbyhNiU531JejYJ/I3ZrDhXfYH3qFZiYxnH1sifvwV+fnTtMXpPN7qPZwIymkjcmm6gJF51e0C7VOfUbvKFv0ngwj+ul21rgZSMuoEvxPK0WxtE3/ZSfn9c="
    - APT_DEPENDENCIES="doxygen libeigen3-dev libboost-test-dev libboost-python-dev python-numpy"
    - DEBSIGN_KEYID=5AE5CD75
    - CC=gcc
    - DO_COVERAGE_ON_BRANCH="master;release"
    - DO_CPPCHECK_ON_BRANCH=""
    - DO_INSTALL_DOC_EXCEPT_ON_BRANCH=""
    - MAKEFLAGS="-j2"

jobs:
  include:
    - dist: bionic
      env: 
        - BUILDTYPE=Release
        - TRAVIS_PYTHON_VERSION=27 
      python: 2.7
    - dist: bionic
      env: 
        - BUILDTYPE=Release
        - TRAVIS_PYTHON_VERSION=36
      python: 3.6
    - dist: bionic
      env: 
        - BUILDTYPE=Debug
        - TRAVIS_PYTHON_VERSION=27 
      python: 2.7
    - dist: bionic
      env: 
        - BUILDTYPE=Debug
        - TRAVIS_PYTHON_VERSION=36
      python: 3.6
    - dist: xenial
      env: 
        - BUILDTYPE=Release
        - TRAVIS_PYTHON_VERSION=27 
      python: 2.7
    - dist: xenial
      env: 
        - BUILDTYPE=Release
        - TRAVIS_PYTHON_VERSION=35 
      python: 3.5
    - dist: trusty 
      env: 
        - BUILDTYPE=Release
        - TRAVIS_PYTHON_VERSION=27 
      python: 2.7
    - dist: trusty 
      env: 
        - BUILDTYPE=Release
        - TRAVIS_PYTHON_VERSION=34
      python: 3.4

notifications:
  email:
    - pinocchio-build@laas.fr
branches:
  only:
    - master
    - debian
    - devel
before_install: ./travis_custom/custom_before_install
install: pip install coveralls numpy --user
script:
  - export CMAKE_ADDITIONAL_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILDTYPE}"
  - ./.travis/run ../travis_custom/custom_build
  - cd $TRAVIS_BUILD_DIR/unittest/cmake
  - mkdir build
  - cd build
  - export CMAKE_PREFIX_PATH=/tmp/_ci/install
  - export PYTHON_DEFAULT_VERSION=$(which python2)
  - if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then export PYTHON_DEFAULT_VERSION=$(which python3); fi
  - cmake .. -DPYTHON_EXECUTABLE=$PYTHON_DEFAULT_VERSION 
  - make
  - ./extra_lib
  - cd /tmp/_ci/build
  - make uninstall 
after_failure: ./.travis/run after_failure
after_success: ./.travis/run after_success
