.travis.yml 1.5 KB
Newer Older
Y
Yu Yang 已提交
1 2 3 4
language: cpp
cache: ccache
sudo: required
dist: trusty
Y
Yu Yang 已提交
5 6 7
os:
  - linux
  - osx
Y
Yu Yang 已提交
8 9 10
env:
  - JOB=DOCS
  - JOB=BUILD_AND_TEST
Y
Yu Yang 已提交
11
  - JOB=PRE_COMMIT
Y
Yu Yang 已提交
12 13 14
matrix:
  exclude:
    - os: osx
Y
Yu Yang 已提交
15 16 17
      env: JOB=DOCS  # Only generate documentation in linux.
    - os: osx
      env: JOB=PRE_COMMIT # Only check pre-commit hook in linux
Y
Yu Yang 已提交
18

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