From 31c7b0b8e2246b21c8db3b5b4bb89bdc8160e1f3 Mon Sep 17 00:00:00 2001 From: Ryan Schmitt Date: Fri, 27 Jul 2018 21:55:39 -0700 Subject: [PATCH] Update Trust to v0.1.2 --- .travis.yml | 39 ++++++++++++++------------------------- Cross.toml | 10 ++++++++++ appveyor.yml | 5 ++--- ci/before_deploy.sh | 2 +- ci/install.sh | 37 ++++++++++++++++++++++++++++++------- ci/script.sh | 3 +-- src/screen/windows.rs | 2 +- 7 files changed, 59 insertions(+), 39 deletions(-) create mode 100644 Cross.toml diff --git a/.travis.yml b/.travis.yml index 027247a..5a3f8a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,51 +1,33 @@ -# Based on the "trust" template v0.1.1 -# https://github.com/japaric/trust/tree/v0.1.1 +# Based on the "trust" template v0.1.2 +# https://github.com/japaric/trust/tree/v0.1.2 dist: trusty language: rust services: docker sudo: required -rust: stable - env: global: - CRATE_NAME=heatseeker - RUST_BACKTRACE=1 - # default job - - TARGET=x86_64-unknown-linux-gnu - matrix: include: # Linux - # - env: TARGET=i686-unknown-linux-gnu - # - env: TARGET=i686-unknown-linux-musl - # - env: TARGET=x86_64-unknown-linux-gnu # this is the default job + - 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 + - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 + # https://github.com/japaric/trust/issues/101 # - env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 - # Other architectures - # - env: TARGET=aarch64-unknown-linux-gnu - # - env: TARGET=armv7-unknown-linux-gnueabihf - # - 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 + # Windows + - env: TARGET=x86_64-pc-windows-gnu # Testing other channels - env: TARGET=x86_64-unknown-linux-gnu @@ -54,6 +36,11 @@ matrix: os: osx rust: nightly + +before_install: + - set -e + - rustup self update + install: - sh ci/install.sh - source ~/.cargo/env || true @@ -61,6 +48,8 @@ install: script: - bash ci/script.sh +after_script: set +e + before_deploy: - sh ci/before_deploy.sh diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..aa67cdb --- /dev/null +++ b/Cross.toml @@ -0,0 +1,10 @@ +[build.env] +passthrough = [ + "APPVEYOR", + "CARGO_PKG_VERSION", + "OUT_DIR", + "RUST_BACKTRACE", + "RUST_LOG", + "TARGET", + "TRAVIS", +] diff --git a/appveyor.yml b/appveyor.yml index c24fc1d..81251ed 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ -# Based on the "trust" template v0.1.1 -# https://github.com/japaric/trust/tree/v0.1.1 +# Based on the "trust" template v0.1.2 +# https://github.com/japaric/trust/tree/v0.1.2 environment: global: @@ -36,7 +36,6 @@ install: - rustc -Vv - cargo -V -# This is the "test phase" test_script: # we don't run the "test phase" when doing deploys - if [%APPVEYOR_REPO_TAG%]==[false] ( diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh index 7bc9054..bc999b6 100644 --- a/ci/before_deploy.sh +++ b/ci/before_deploy.sh @@ -18,7 +18,7 @@ main() { test -f Cargo.lock || cargo generate-lockfile cross rustc --bin hs --target $TARGET --release -- -C lto - cp target/$TARGET/release/hs $stage/ + cp target/$TARGET/release/hs* $stage/ cd $stage tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz * diff --git a/ci/install.sh b/ci/install.sh index 4093c9b..80e18e4 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -1,23 +1,46 @@ set -ex main() { - curl https://sh.rustup.rs -sSf | \ - sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION - local target= if [ $TRAVIS_OS_NAME = linux ]; then - target=x86_64-unknown-linux-gnu + target=x86_64-unknown-linux-musl + sort=sort else target=x86_64-apple-darwin + sort=gsort # for `sort --sort-version`, from brew's coreutils. fi - # TODO At some point you'll probably want to use a newer release of `cross`, - # simply change the argument to `--tag`. + # Builds for iOS are done on OSX, but require the specific target to be + # installed. + case $TARGET in + aarch64-apple-ios) + rustup target install aarch64-apple-ios + ;; + armv7-apple-ios) + rustup target install armv7-apple-ios + ;; + armv7s-apple-ios) + rustup target install armv7s-apple-ios + ;; + i386-apple-ios) + rustup target install i386-apple-ios + ;; + x86_64-apple-ios) + rustup target install x86_64-apple-ios + ;; + esac + + # This fetches latest stable release + local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \ + | cut -d/ -f3 \ + | grep -E '^v[0.1.0-9.]+$' \ + | $sort --version-sort \ + | tail -n1) curl -LSfs https://japaric.github.io/trust/install.sh | \ sh -s -- \ --force \ --git japaric/cross \ - --tag v0.1.4 \ + --tag $tag \ --target $target } diff --git a/ci/script.sh b/ci/script.sh index 8566cc5..679e059 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -2,12 +2,11 @@ set -ex -# This is the "test phase" main() { cross build --target $TARGET cross build --target $TARGET --release - if [ -n $DISABLE_TESTS ]; then + if [ ! -z $DISABLE_TESTS ]; then return fi diff --git a/src/screen/windows.rs b/src/screen/windows.rs index 330e0cc..72495e0 100644 --- a/src/screen/windows.rs +++ b/src/screen/windows.rs @@ -295,7 +295,7 @@ mod tests { #[test] fn winsize_test() { // AppVeyor builds run without a console, making this test impossible. - if option_env!("APPVEYOR").is_some() { + if option_env!("APPVEYOR").is_some() || option_env!("TRAVIS").is_some() { // TODO: It should be made obvious from the output that this test was skipped return; }