Skip to content

Commit

Permalink
Update Trust to v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rschmitt committed Jul 28, 2018
1 parent 638256d commit 31c7b0b
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 39 deletions.
39 changes: 14 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -54,13 +36,20 @@ matrix:
os: osx
rust: nightly


before_install:
- set -e
- rustup self update

install:
- sh ci/install.sh
- source ~/.cargo/env || true

script:
- bash ci/script.sh

after_script: set +e

before_deploy:
- sh ci/before_deploy.sh

Expand Down
10 changes: 10 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[build.env]
passthrough = [
"APPVEYOR",
"CARGO_PKG_VERSION",
"OUT_DIR",
"RUST_BACKTRACE",
"RUST_LOG",
"TARGET",
"TRAVIS",
]
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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] (
Expand Down
2 changes: 1 addition & 1 deletion ci/before_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
37 changes: 30 additions & 7 deletions ci/install.sh
Original file line number Diff line number Diff line change
@@ -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
}

Expand Down
3 changes: 1 addition & 2 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/screen/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 31c7b0b

Please sign in to comment.