.travis.yml 1.7 KB
Newer Older
Y
Yu Yang 已提交
1
language: cpp
2 3 4 5
cache:
  directories:
    - $HOME/third_party
    - $HOME/.ccache
Y
Yu Yang 已提交
6
    - $HOME/.cache/pip
Y
Yu Yang 已提交
7 8
sudo: required
dist: trusty
Y
Yu Yang 已提交
9 10
os:
  - linux
Y
Yu Yang 已提交
11 12 13
env:
  - JOB=DOCS
  - JOB=BUILD_AND_TEST
Y
Yu Yang 已提交
14
  - JOB=PRE_COMMIT
Y
Yu Yang 已提交
15 16 17 18 19
addons:
  apt:
    packages:
      - gcc-4.8
      - g++-4.8
L
liaogang 已提交
20
      - gfortran-4.8
Y
Yu Yang 已提交
21 22
      - git
      - build-essential
23
      - python
Y
Yu Yang 已提交
24
      - python-pip
25
      - python2.7-dev
26 27
      - python-numpy
      - python-wheel
L
liaogang 已提交
28
      - libboost-dev
G
gangliao 已提交
29
      - curl
L
liaogang 已提交
30
      - swig
Y
Yu Yang 已提交
31
      - graphviz
Y
Yu Yang 已提交
32
      - clang-format-3.8
33 34
      - automake
      - libtool
35
      - ccache
Y
Yu Yang 已提交
36
before_install:
37 38
  - |
    if [ ${JOB} == "BUILD_AND_TEST" ]; then
Y
Yu Yang 已提交
39 40 41 42 43 44 45
      local change_list=`git diff --name-only $TRAVIS_COMMIT_RANGE`
      if [ $? -eq 0 ]; then  # if git diff return no zero, then rerun unit test.
        if ! echo ${change_list} | grep -qvE '(\.md$)|(\.rst$)|(\.jpg$)|(\.png$)'
        then
          echo "Only markdown docs were updated, stopping build process."
          exit
        fi
L
liaogang 已提交
46
      fi
47
    fi
Y
Yu Yang 已提交
48
  - if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
Y
Yu Yang 已提交
49 50
  # Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python 
  # protobuf version.
D
dzhwinter 已提交
51 52
  - pip install numpy wheel 'protobuf==3.1' sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit requests==2.9.2 LinkChecker
  - pip install rarfile
Y
Yu Yang 已提交
53 54
  - |
    function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
Y
Yu Yang 已提交
55
script:
Y
Yu Yang 已提交
56 57 58
  - | 
    timeout 2580 paddle/scripts/travis/main.sh  # 43min timeout
    RESULT=$?; if [ $RESULT -eq 0 ] || [ $RESULT -eq 142 ]; then true; else false; fi;
Y
Yu Yang 已提交
59 60 61 62
notifications:
  email:
    on_success: change
    on_failure: always