diff --git a/.travis.yml b/.travis.yml index 253f1aa23..7b475876b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,25 +3,30 @@ sudo: true language: minimal -cache: cargo +cache: + cargo: true + directories: + - $HOME/build/darwinia-network/darwinia/node/runtime/wasm/target/wasm32-unknown-unknown/release branches: only: - - master + - master env: global: - RUST_BACKTRACE=1 - matrix: - - RUST_TOOLCHAIN=nightly TARGET=wasm - - RUST_TOOLCHAIN=stable TARGET=native before_install: # Check how much space we've got on this machine. - df -h + - ls $HOME/build/darwinia-network/darwinia/node/runtime/wasm/target/wasm32-unknown-unknown/release -script: - - ./ci/script.sh +jobs: + include: + - stage: Install + script: ./ci/script.sh nightly wasm + - stage: Test + script: ./ci/script.sh stable native after_script: # Check how much free disk space left after the build diff --git a/ci/script.sh b/ci/script.sh index e3f86d316..67dcd4e89 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -3,7 +3,7 @@ set -eux # Install rustup and the specified rust toolchain. -curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$RUST_TOOLCHAIN -y +curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$1 -y # Load cargo environment. Specifically, put cargo into PATH. source ~/.cargo/env @@ -12,17 +12,17 @@ rustc --version rustup --version cargo --version -case $TARGET in +case $2 in "native") sudo apt-get -y update sudo apt-get install -y cmake pkg-config libssl-dev - cargo test --all --locked "$@" + cargo test --all --locked ;; "wasm") # Install prerequisites and build all wasm projects ./init.sh - ./build.sh --locked "$@" + ./build.sh --locked ;; esac \ No newline at end of file