.travis.yml 1.7 KB
language: cpp
cache: ccache
sudo: required
dist: trusty
os:
  - linux
  - osx
env:
  - JOB=DOCS
  - JOB=BUILD_AND_TEST
  - JOB=PRE_COMMIT
matrix:
  exclude:
    - os: osx
      env: JOB=DOCS  # Only generate documentation in linux.
    - os: osx
      env: JOB=PRE_COMMIT # Only check pre-commit hook in linux

addons:
  apt:
    packages:
      - gcc-4.8
      - g++-4.8
      - wget
      - git
      - build-essential
      - libatlas-base-dev
      - python
      - python-pip
      - python2.7-dev
      - m4
      - libprotobuf-dev
      - doxygen
      - protobuf-compiler
      - python-protobuf
      - python-numpy
      - python-wheel
      - libgoogle-glog-dev
      - libgflags-dev
      - libgtest-dev
      - curl
      - lcov
      - graphviz
      - swig
      - clang-format-3.8
before_install:
  - |
    if [ ${JOB} == "BUILD_AND_TEST" ]; then
      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
      fi
    fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo paddle/scripts/travis/before_install.linux.sh; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi
  - if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
  - pip install wheel protobuf sphinx recommonmark virtualenv numpy sphinx_rtd_theme pre-commit
script:
  - paddle/scripts/travis/main.sh
notifications:
  email:
    on_success: change
    on_failure: always
反馈
建议
客服 返回
顶部