Skip to content

Reduce ios builds #815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@ matrix:
# likes to have a big backlog on builds on those machines. This way at least
# all of the other jobs can finish while waiting on those builds.
include:
# iOS builds
# These are all done on a single machine because Travis rations their OS X
# builders so heavily that we otherwise can't merge PRs during the work week.
# Additionally they're moved to the front of the line to get them in the Travis
# OS X build queue first.
- env: TARGET="aarch64-apple-ios;armv7-apple-ios;armv7s-apple-ios;i386-apple-ios;x86_64-apple-ios" DISABLE_TESTS=1
rust: 1.20.0
os: osx

# Mac builds
# These are also moved to be first because they wait in a long queue with Travis
- env: TARGET=i686-apple-darwin
rust: 1.20.0
os: osx
- env: TARGET=x86_64-apple-darwin
rust: 1.20.0
os: osx

# Android
- env: TARGET=aarch64-linux-android DISABLE_TESTS=1
rust: 1.20.0
- env: TARGET=arm-linux-androideabi DISABLE_TESTS=1
rust: 1.20.0
- env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1
rust: 1.20.0
- env: TARGET=aarch64-apple-ios DISABLE_TESTS=1
rust: 1.20.0
os: osx
- env: TARGET=i686-linux-android DISABLE_TESTS=1
rust: 1.20.0
- env: TARGET=x86_64-linux-android DISABLE_TESTS=1
Expand All @@ -34,45 +49,30 @@ matrix:
# Linux
- env: TARGET=aarch64-unknown-linux-gnu
rust: 1.20.0
- env: TARGET=armv7-apple-ios DISABLE_TESTS=1
rust: 1.20.0
os: osx
- env: TARGET=arm-unknown-linux-gnueabi
rust: 1.20.0
- env: TARGET=arm-unknown-linux-musleabi DISABLE_TESTS=1
rust: 1.20.0
- env: TARGET=armv7-unknown-linux-gnueabihf
rust: 1.20.0
- env: TARGET=armv7s-apple-ios DISABLE_TESTS=1
rust: 1.20.0
os: osx
- env: TARGET=i686-unknown-linux-gnu
rust: 1.20.0
- env: TARGET=i686-unknown-linux-musl
rust: 1.20.0
- env: TARGET=mips-unknown-linux-gnu
rust: 1.20.0
- env: TARGET=i386-apple-ios DISABLE_TESTS=1
rust: 1.20.0
os: osx
- env: TARGET=mips64-unknown-linux-gnuabi64
rust: 1.20.0
- env: TARGET=mips64el-unknown-linux-gnuabi64
rust: 1.20.0
- env: TARGET=mipsel-unknown-linux-gnu
rust: 1.20.0
- env: TARGET=x86_64-apple-ios DISABLE_TESTS=1
rust: 1.20.0
os: osx
- env: TARGET=powerpc-unknown-linux-gnu DISABLE_TESTS=1
rust: 1.20.0
- env: TARGET=powerpc64-unknown-linux-gnu
rust: 1.20.0
- env: TARGET=powerpc64le-unknown-linux-gnu
rust: 1.20.0
- env: TARGET=i686-apple-darwin
rust: 1.20.0
os: osx
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
rust: 1.20.0
- env: TARGET=x86_64-unknown-linux-gnu
Expand All @@ -89,18 +89,14 @@ matrix:
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
rust: 1.20.0

- env: TARGET=x86_64-apple-darwin
rust: 1.20.0
os: osx

# Make sure stable is always working too
- env: TARGET=x86_64-unknown-linux-gnu
rust: stable

before_install: set -e

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

script:
Expand Down
38 changes: 21 additions & 17 deletions ci/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -ex

main() {
Expand All @@ -12,23 +13,26 @@ main() {

# 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
IFS=';' read -ra TARGET_ARRAY <<< "$TARGET"
for t in "${TARGET_ARRAY[@]}"; do
case $t 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
done

# This fetches latest stable release
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
Expand Down
22 changes: 13 additions & 9 deletions ci/script.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# This script takes care of testing your crate

set -ex
Expand All @@ -8,17 +9,20 @@ main() {
export RUSTFLAGS=--cfg=travis
fi

# Build debug and release targets
cross build --target $TARGET
cross build --target $TARGET --release
IFS=';' read -ra TARGET_ARRAY <<< "$TARGET"
for t in "${TARGET_ARRAY[@]}"; do
# Build debug and release targets
cross build --target $t
cross build --target $t --release

if [ ! -z $DISABLE_TESTS ]; then
return
fi
if [ ! -z $DISABLE_TESTS ]; then
continue
fi

# Run tests on debug and release targets.
cross test --target $TARGET
cross test --target $TARGET --release
# Run tests on debug and release targets.
cross test --target $t
cross test --target $t --release
done
}

# we don't run the "test phase" when doing deploys
Expand Down