From 8e9983bd7f2fe018720a3f5aa33d9f3e0b90e9fb Mon Sep 17 00:00:00 2001 From: Evans Murithi Date: Tue, 7 Aug 2018 22:24:12 +0300 Subject: Update ci configs --- .travis.yml | 43 ++++++++++++++++++++++++++++++++++++++----- appveyor.yml | 2 +- ci/before_deploy.sh | 3 +-- ci/script.sh | 23 +++++++++++++++++++++++ 4 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 ci/script.sh diff --git a/.travis.yml b/.travis.yml index 8f923d8..9047e68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,16 +14,49 @@ before_cache: env: global: - CRATE_NAME=cloak - - TARGET=x86_64-unknown-linux-gnu + +matrix: + include: + # Linux + - env: TARGET=aarch64-unknown-linux-gnu + - env: TARGET=arm-unknown-linux-gnueabi + - env: TARGET=armv7-unknown-linux-gnueabihf + - env: TARGET=i686-unknown-linux-gnu + - env: TARGET=i686-unknown-linux-musl + - env: TARGET=mips-unknown-linux-gnu + - env: TARGET=mips64-unknown-linux-gnuabi64 + - env: TARGET=mips64el-unknown-linux-gnuabi64 + - env: TARGET=mipsel-unknown-linux-gnu + - env: TARGET=powerpc-unknown-linux-gnu + - env: TARGET=powerpc64-unknown-linux-gnu + - env: TARGET=powerpc64le-unknown-linux-gnu + - env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1 + - env: TARGET=x86_64-unknown-linux-gnu + - env: TARGET=x86_64-unknown-linux-musl + + # OSX + - env: TARGET=i686-apple-darwin + os: osx + - env: TARGET=x86_64-apple-darwin + os: osx + + # *BSD + - env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1 + - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 + - env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 + +before_install: + - set -e + - rustup self update install: - sh ci/install.sh - - export PATH=$PATH:$HOME/.cargo/bin + - source ~/.cargo/env || true script: - - cargo build --all --no-default-features - - cargo build --verbose - - cargo test --verbose + - bash ci/script.sh + +after_script: set +e before_deploy: - sh ci/before_deploy.sh diff --git a/appveyor.yml b/appveyor.yml index 05ebf9d..854585c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ before_deploy: # Generate artifacts for release - cargo build --release - mkdir staging - - copy target\release\mdbook.exe staging + - copy target\release\cloak.exe staging - cd staging - 7z a ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip * - appveyor PushArtifact ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh index fc4915b..8eba8d1 100644 --- a/ci/before_deploy.sh +++ b/ci/before_deploy.sh @@ -15,8 +15,7 @@ main() { ;; esac - # This will slow down the build, but is necessary to not run out of disk space - cargo clean + test -f Cargo.lock || cargo generate-lockfile cross rustc --bin cloak --target $TARGET --release -- -C lto diff --git a/ci/script.sh b/ci/script.sh new file mode 100644 index 0000000..d1e3094 --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,23 @@ +# This script takes care of testing your crate + +set -ex + +main() { + cross build --target $TARGET + cross build --target $TARGET --release + + if [ ! -z $DISABLE_TESTS ]; then + return + fi + + cross test --target $TARGET + cross test --target $TARGET --release + + cross run --target $TARGET + cross run --target $TARGET --release +} + +# we don't run the "test phase" when doing deploys +if [ -z $TRAVIS_TAG ]; then + main +fi -- cgit v1.2.3