From d860ded3f0b5c44db024f9ee9274a6d69e99e71b Mon Sep 17 00:00:00 2001 From: bin liu Date: Thu, 17 Sep 2020 21:17:44 +0800 Subject: [PATCH] ci: use Travis cache to reduce build time This PR includes these changes: - use Rust installed by Travis - install x86_64-unknown-linux-musl - install rustfmt - use Travis cache - delete ci/install_vc.sh Fixes: #748 Signed-off-by: bin liu --- .travis.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 672c209d64..c0414d5818 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,22 @@ dist: bionic os: linux -language: go -go: 1.14.4 + +# set cache directories manually, because +# we are using a non-standard directory struct +# cargo root is in srs/agent +# +# If needed, caches can be cleared +# by ways documented in +# https://docs.travis-ci.com/user/caching#clearing-caches +language: rust +rust: + - 1.44.1 +cache: + cargo: true + directories: + - src/agent/target + env: - target_branch=$TRAVIS_BRANCH - RUST_BACKTRACE=1 @@ -19,16 +33,17 @@ before_install: # we use install to run check agent # so that it is easy to skip for non-amd64 platform install: - - "ci/install_rust.sh" - export PATH=$PATH:"$HOME/.cargo/bin" - export RUST_AGENT=yes + - rustup target add x86_64-unknown-linux-musl + - sudo ln -sf /usr/bin/g++ /bin/musl-g++ + - rustup component add rustfmt - make -C ${TRAVIS_BUILD_DIR}/src/agent - make -C ${TRAVIS_BUILD_DIR}/src/agent check - sudo -E PATH=$PATH make -C ${TRAVIS_BUILD_DIR}/src/agent check before_script: - "ci/install_go.sh" - - "ci/install_vc.sh" - make -C ${TRAVIS_BUILD_DIR}/src/runtime - make -C ${TRAVIS_BUILD_DIR}/src/runtime test - sudo -E PATH=$PATH GOPATH=$GOPATH make -C ${TRAVIS_BUILD_DIR}/src/runtime test