.travis.yml 1.7 KB
Newer Older
Y
Yu Yang 已提交
1
language: cpp
2 3 4
cache:
  directories:
    - $HOME/.ccache
Y
Yu Yang 已提交
5
    - $HOME/.cache/pip
Y
Yu Yang 已提交
6
    - $TRAVIS_BUILD_DIR/build/third_party
7
    - $TRAVIS_BUILD_DIR/build_android/third_party
Y
Yu Yang 已提交
8 9
sudo: required
dist: trusty
10 11
services:
  - docker
Y
Yu Yang 已提交
12 13
os:
  - linux
Y
Yu Yang 已提交
14
env:
15
  - JOB=doc
Y
Yi Wang 已提交
16
  - JOB=check_style
17
  - JOB=build_android
Y
Yu Yang 已提交
18 19 20 21 22 23 24
addons:
  apt:
    packages:
      - gcc-4.8
      - g++-4.8
      - git
      - build-essential
25
      - python
Y
Yu Yang 已提交
26
      - python-pip
27
      - python2.7-dev
28
      - python-wheel
L
liaogang 已提交
29
      - libboost-dev
G
gangliao 已提交
30
      - curl
L
liaogang 已提交
31
      - swig
Y
Yu Yang 已提交
32
      - graphviz
Y
Yu Yang 已提交
33
      - clang-format-3.8
34 35
      - automake
      - libtool
36
      - ccache
37
  ssh_known_hosts: 13.229.163.131
Y
Yu Yang 已提交
38
before_install:
39 40
  - sudo pip install -r $TRAVIS_BUILD_DIR/python/requirements.txt
  - sudo pip install wheel sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit
Y
Yu Yang 已提交
41 42
  - |
    function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
Y
Yu Yang 已提交
43
script:
44
  - |
45
    # 43min timeout
46
    if [[ "$JOB" != "doc" ]]; then timeout 2580 paddle/scripts/paddle_docker_build.sh ${JOB}; else timeout 2580 paddle/scritps/paddle_build.sh ${JOB}; fi; 
47
    if [ $? -eq 0 ] || [ $? -eq 142 ]; then true; else exit 1; fi;
D
daming-lu 已提交
48
  - |
49 50
    if [[ "$JOB" != "doc" ]]; then exit 0; fi;
    # For document only
D
daming-lu 已提交
51 52 53 54 55
    if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi;
    if [[ "$TRAVIS_BRANCH" != "develop"  && ! "$TRAVIS_BRANCH" =~ ^v[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?(-\S*)?$ ]]; then exit 0; fi;
    export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/master/scripts/deploy/deploy_docs.sh
    export DOCS_DIR=`pwd`
    cd ..
L
Luo Tao 已提交
56
    curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH $DOCS_DIR $DOCS_DIR/build/doc/
Y
Yu Yang 已提交
57 58 59 60
notifications:
  email:
    on_success: change
    on_failure: always