language: cpp
cache:
  bundler: true
  directories:
    - $HOME/.ccache
    - $HOME/.cache/pip
    - $HOME/docker
    - $TRAVIS_BUILD_DIR/external/Paddle/build/third_party

sudo: required
dist: trusty
services:
  - docker
os:
  - linux

addons:
  apt:
    packages:
      - git
      - python
      - python-pip
      - python2.7-dev
  ssh_known_hosts: 13.229.163.131
before_install:
  - sudo pip install pylint pytest astroid isort 

before_install:
  - sudo pip install pylint pytest astroid isort
  # Force the script to be timed out after certain duration
  - function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }

jobs:
  include:
    # Force the deploy_docs.sh to time out after 40 minutes.
    # Travis CI will terminate the build completely after 50 minutes and won't allow caching to happen.
    # Time out the build preemptively to cache built libraries.
    - script: timeout 2400 scripts/deploy_docs.sh full
      name: Generate Docs
    
notifications:
  email:
    on_success: change
    on_failure: always
