.travis.yml 1.5 KB
Newer Older
Y
Yu Yang 已提交
1
language: cpp
2 3 4 5 6
cache:
  directories:
    - $HOME/third_party
    - $HOME/.ccache

Y
Yu Yang 已提交
7 8
sudo: required
dist: trusty
Y
Yu Yang 已提交
9 10 11
os:
  - linux
  - osx
Y
Yu Yang 已提交
12 13 14
env:
  - JOB=DOCS
  - JOB=BUILD_AND_TEST
Y
Yu Yang 已提交
15
  - JOB=PRE_COMMIT
Y
Yu Yang 已提交
16 17 18
matrix:
  exclude:
    - os: osx
Y
Yu Yang 已提交
19 20 21
      env: JOB=DOCS  # Only generate documentation in linux.
    - os: osx
      env: JOB=PRE_COMMIT # Only check pre-commit hook in linux
Y
Yu Yang 已提交
22

Y
Yu Yang 已提交
23 24 25 26 27 28 29
addons:
  apt:
    packages:
      - gcc-4.8
      - g++-4.8
      - git
      - build-essential
L
liaogang 已提交
30
      - libatlas-base-dev
31
      - python
Y
Yu Yang 已提交
32
      - python-pip
33
      - python2.7-dev
34 35
      - python-numpy
      - python-wheel
G
gangliao 已提交
36
      - curl
L
liaogang 已提交
37
      - swig
Y
Yu Yang 已提交
38
      - graphviz
Y
Yu Yang 已提交
39
      - clang-format-3.8
40 41
      - automake
      - libtool
42
      - ccache
Y
Yu Yang 已提交
43
before_install:
44 45
  - |
    if [ ${JOB} == "BUILD_AND_TEST" ]; then
Y
Yu Yang 已提交
46 47 48 49 50 51 52
      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 已提交
53
      fi
54
    fi
Y
Yu Yang 已提交
55
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi
Y
Yu Yang 已提交
56
  - if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
57
  - pip install numpy wheel protobuf sphinx recommonmark sphinx_rtd_theme virtualenv pre-commit requests==2.9.2 LinkChecker
Y
Yu Yang 已提交
58
script:
Y
Yu Yang 已提交
59
  - paddle/scripts/travis/main.sh
Y
Yu Yang 已提交
60 61 62 63
notifications:
  email:
    on_success: change
    on_failure: always