From 0845b893d028cefa9bb65a768c245965a9f5133a Mon Sep 17 00:00:00 2001 From: longfangsong Date: Thu, 11 Jun 2020 10:58:38 +0800 Subject: [PATCH] fix ci Signed-off-by: longfangsong --- .travis.yml | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8babdcd7..1ec7d1d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,8 @@ os: # - windows # TODO: https://github.com/pingcap/kvproto/issues/355 - osx rust: - - stable - - nightly + - 1.42.0 + - nightly-2020-01-07 env: global: @@ -28,27 +28,34 @@ addons: - go install: - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "stable" ]]; then rustup component add rustfmt; fi - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "stable" ]]; then rustup component add clippy; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "1.42.0" ]]; then rustup component add rustfmt; fi + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then + wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz; + tar -xf go1.14.1.linux-amd64.tar.gz -C $HOME; + export PATH="$HOME/go/bin:$PATH"; + export GOROOT=$HOME/go; + fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "1.42.0" ]]; then rustup component add clippy; fi - if [[ $TRAVIS_OS_NAME == "windows" ]]; then choco install golang cmake strawberryperl protoc; fi - if [[ $TRAVIS_OS_NAME == "windows" ]]; then export PATH="$PATH:/c/Go/bin/:/c/Program Files/CMake/bin"; fi before_script: + echo "" - eval "$(gimme stable)" script: - which go && go version - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "stable" ]]; then cargo fmt -- --check; fi - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "stable" ]]; then cargo clippy -- -D clippy::all; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "1.42.0" ]]; then cargo fmt -- --check; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "1.42.0" ]]; then cargo clippy -- -D clippy::all; fi - cargo build --all - cargo build --examples - - if [[ $TRAVIS_RUST_VERSION == "nightly" ]]; then cargo test --all -- --nocapture; fi - # For now we only run full integration tests on Linux. Here's why: - # * Docker on OS X is not supported by Travis. - # * Docker on Windows seems to not have the correct binary at `"/c/Program Files/Docker/Docker/DockerCli.exe" to switch it to Linux containers. - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly" ]]; then docker run -d --net=host --name pd --rm pingcap/pd:nightly --name "pd" --data-dir "pd" --client-urls "http://127.0.0.1:2379" --advertise-client-urls "http://127.0.0.1:2379"; fi - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly" ]]; then docker run -d --net=host --name kv --rm --ulimit nofile=90000:90000 pingcap/tikv:nightly --pd-endpoints "127.0.0.1:2379" --addr "127.0.0.1:2378" --data-dir "kv"; fi - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly" ]]; then docker ps; fi - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly" ]]; then docker logs pd; fi - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly" ]]; then docker logs kv; fi - - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly" ]]; then PD_ADDRS="127.0.0.1:2379" cargo test --all --features integration-tests -- --nocapture; fi + - if [[ $TRAVIS_RUST_VERSION == "nightly-2020-01-07" ]]; then cargo test --all -- --nocapture; fi + # For now we only run full integration tests on Linux. Here's why: + # * Docker on OS X is not supported by Travis. + # * Docker on Windows seems to not have the correct binary at `"/c/Program Files/Docker/Docker/DockerCli.exe" to switch it to Linux containers. + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly-2020-01-07" ]]; then docker run -d --net=host --name pd --rm pingcap/pd:nightly --name "pd" --data-dir "pd" --client-urls "http://127.0.0.1:2379" --advertise-client-urls "http://127.0.0.1:2379"; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly-2020-01-07" ]]; then docker run -d --net=host --name kv --rm --ulimit nofile=90000:90000 pingcap/tikv:nightly --pd-endpoints "127.0.0.1:2379" --addr "127.0.0.1:2378" --data-dir "kv"; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly-2020-01-07" ]]; then docker ps; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly-2020-01-07" ]]; then docker logs pd; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly-2020-01-07" ]]; then docker logs kv; fi + - if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "nightly-2020-01-07" ]]; then PD_ADDRS="127.0.0.1:2379" cargo test --all --features integration-tests -- --nocapture; fi