# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Rene Rivera 2015-2016.
# Copyright Peter Dimov 2017.

branches:
  only:
    - master
    - develop
    - /feature\/.*/

dist: xenial

language: cpp

compiler: gcc

addons:
  apt:
    packages:
      - p7zip-full
      - docutils-common
      - docutils-doc
      - python-docutils
      - docbook
      - docbook-xml
      - docbook-xsl
      - xsltproc
      - doxygen
      - dvipsk-ja
      - texlive
      - sshpass
      - ghostscript
      - libsaxonhe-java
  ssh_known_hosts: frs.sourceforge.net

env:
  matrix:
    - TRAVIS_EMPTY_JOB_WORKAROUND=true

matrix:
  exclude:
    - env: TRAVIS_EMPTY_JOB_WORKAROUND=true

  include:

    - env: SCRIPT=ci_boost_release MODE=check

    # Simple integrated status tests check.
    - env: SCRIPT=ci_boost_status

    # Same, but using release layout
    - env: SCRIPT=ci_boost_status RELEASE=1

    # Run 'quick' tests.
    - env: SCRIPT=ci_boost_status TARGET=quick TOOLSET=gcc CXXSTD=03,11
      compiler: g++

    - env: SCRIPT=ci_boost_status TARGET=quick TOOLSET=clang CXXSTD=03,11
      compiler: clang++

    # Build Boost
    - env: SCRIPT=ci_boost_build TOOLSET=gcc CXXSTD=11
      compiler: g++

    # Build Boost with release layout
    - env: SCRIPT=ci_boost_build TOOLSET=gcc CXXSTD=11 RELEASE=1
      compiler: g++

#    # Run tests for the library updated by this commit.
#    - env: SCRIPT=ci_boost_test_library TOOLSET=gcc CXXSTD=11
#      compiler: g++
#
#    - env: SCRIPT=ci_boost_test_library TOOLSET=clang CXXSTD=11
#      compiler: clang++
#
#    # Library requirements tests.
#    - env: SCRIPT=ci_boost_library_check
#
#  allow_failures:
#    - env: SCRIPT=ci_boost_library_check

before_install:
  # Fetch the scripts to do the actual building/testing.
  - |
    wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/ci_boost_common.py" -P ..
    wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/${SCRIPT}.py" -P ..
    rvm install 2.3.3

install: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" install
before_script: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" before_script
script: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" script
after_success: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" after_success
after_failure: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" after_failure
after_script: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" after_script
