Take again the Travis-CI double speed optimization and plus fix (#1687)

* restore the script from pr#1647
* fix: build failure need return the error code
* fix: semicolon can't dismiss
This commit is contained in:
Gary Yu 2018-10-09 06:59:54 +08:00 committed by Ignotus Peverell
parent 770aca9a2d
commit 536b905690

View file

@ -13,9 +13,12 @@ sudo: required
cache: cache:
cargo: true cargo: true
timeout: 240 timeout: 240
directories:
- $HOME/.cargo
- $TRAVIS_BUILD_DIR/target
before_cache: before_cache:
- rm -rf target/tmp - rm -rf $TRAVIS_BUILD_DIR/target/tmp
rust: rust:
- stable - stable
@ -42,25 +45,31 @@ env:
- RUST_BACKTRACE="1" - RUST_BACKTRACE="1"
- RUST_FLAGS="-C debug-assertions" - RUST_FLAGS="-C debug-assertions"
matrix: matrix:
- RUST_TEST_THREADS=1 TEST_DIR=servers - TEST_SUITE=servers
- TEST_DIR=store - TEST_SUITE=chain-core
- TEST_DIR=chain - TEST_SUITE=pool-p2p
- TEST_DIR=pool - TEST_SUITE=keychain-wallet
- TEST_DIR=wallet - TEST_SUITE=api-util-store
- TEST_DIR=p2p
- TEST_DIR=api
- TEST_DIR=keychain
- TEST_DIR=core
- TEST_DIR=util
- TEST_DIR=config
- TEST_DIR=none
script: script:
- if [[ "$TEST_DIR" == "none" ]]; then cargo build --release; fi - IFS='-' read -r -a DIRS <<< "$TEST_SUITE"; DIR=${DIRS[0]};
- if [[ "$TEST_DIR" != "none" ]]; then cd $TEST_DIR && cargo test --release; fi echo "start testing on folder $DIR...";
if [[ -n "$DIR" ]]; then cd $DIR && cargo test --release && cd - > /dev/null; fi;
- IFS='-' read -r -a DIRS <<< "$TEST_SUITE"; DIR=${DIRS[1]};
if [[ -n "$DIR" ]]; then
echo "start testing on folder $DIR...";
cd $DIR && cargo test --release && cd - > /dev/null;
fi;
- IFS='-' read -r -a DIRS <<< "$TEST_SUITE"; DIR=${DIRS[2]};
if [[ -n "$DIR" ]]; then
echo "start testing on folder $DIR...";
cd $DIR && cargo test --release && cd - > /dev/null;
fi;
before_deploy: before_deploy:
- if [[ "$TEST_DIR" == "none" ]]; then ./.auto-release.sh; fi - if [[ "TEST_SUITE" == "pool-p2p" ]]; then
cargo clean && cargo build --release && ./.auto-release.sh;
fi
deploy: deploy:
provider: releases provider: releases
@ -72,6 +81,6 @@ deploy:
on: on:
repo: mimblewimble/grin repo: mimblewimble/grin
tags: true tags: true
condition: $TEST_DIR = "none" condition: $TEST_SUITE = "pool-p2p"