diff --git a/.travis.yml b/.travis.yml index fe4eb2d1570fb3dbb38128400e6f438b99236c0d..3391e2c3cab9938c9dc5705b51367c707d3bbe9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,34 +16,14 @@ env: - JOB=check_style - JOB=build_android addons: - apt: - packages: - - gcc-4.8 - - g++-4.8 - - git - - build-essential - - python - - python-pip - - python2.7-dev - - python-wheel - - libboost-dev - - curl - - swig - - graphviz - - clang-format-3.8 - - automake - - libtool - - ccache ssh_known_hosts: 13.229.163.131 before_install: - - 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 - | function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } script: - | # 43min timeout - if [[ "$JOB" != "doc" ]]; then timeout 2580 paddle/scripts/paddle_docker_build.sh ${JOB}; else paddle/scripts/paddle_build.sh ${JOB}; fi; + paddle/scripts/paddle_docker_build.sh ${JOB} if [ $? -eq 0 ] || [ $? -eq 142 ]; then true; else exit 1; fi; - | if [[ "$JOB" != "doc" ]]; then exit 0; fi; diff --git a/paddle/scripts/paddle_docker_build.sh b/paddle/scripts/paddle_docker_build.sh index 311eb576014a741c67c0c6e62740b954a4a02462..ddae9f19a21b404c9b24b47d433e07db4603dc8b 100755 --- a/paddle/scripts/paddle_docker_build.sh +++ b/paddle/scripts/paddle_docker_build.sh @@ -56,11 +56,15 @@ EOL if ! [ -x "$(command -v ${DOCKER_CMD})" ]; then DOCKER_CMD="docker" fi + if [ ! -d "${HOME}/.ccache" ]; then + mkdir ${HOME}/.ccache + fi set -x ${DOCKER_CMD} run -it \ --name $CONTAINER_ID \ ${DOCKER_ENV} \ -v $PADDLE_ROOT:/paddle \ + -v ${HOME}/.ccache:/root/.ccache \ -w /paddle \ $IMG \ paddle/scripts/paddle_build.sh $@