From 7e91a1810dd994c9ae4b168b85ccbc4031974362 Mon Sep 17 00:00:00 2001 From: sunbobin Date: Mon, 8 Jul 2019 13:21:36 +0800 Subject: [PATCH 1/2] try ci --- .travis.yml | 28 ++++++++++++++++++++++++++++ ci/script.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .travis.yml create mode 100644 ci/script.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..253f1aa23 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +# Request an environment that provides sudo (that goes with larger containers) +# and a minimal language environment. +sudo: true +language: minimal + +cache: cargo + +branches: + only: + - 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 + +script: + - ./ci/script.sh + +after_script: + # Check how much free disk space left after the build + - df -h \ No newline at end of file diff --git a/ci/script.sh b/ci/script.sh new file mode 100644 index 000000000..e3f86d316 --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -eux + +# Install rustup and the specified rust toolchain. +curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$RUST_TOOLCHAIN -y + +# Load cargo environment. Specifically, put cargo into PATH. +source ~/.cargo/env + +rustc --version +rustup --version +cargo --version + +case $TARGET in + "native") + sudo apt-get -y update + sudo apt-get install -y cmake pkg-config libssl-dev + + cargo test --all --locked "$@" + ;; + + "wasm") + # Install prerequisites and build all wasm projects + ./init.sh + ./build.sh --locked "$@" + ;; +esac \ No newline at end of file From 801992d3ffd9e455b75c0aab6b0452a6cec95af9 Mon Sep 17 00:00:00 2001 From: sunbobin Date: Mon, 8 Jul 2019 13:25:19 +0800 Subject: [PATCH 2/2] +x script.sh --- ci/script.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ci/script.sh diff --git a/ci/script.sh b/ci/script.sh old mode 100644 new mode 100755