diff options
author | Jakub Kotur <qtr@google.com> | 2021-03-16 20:53:16 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-16 20:53:16 +0000 |
commit | b8f1071dd47cbf67c3d1c6bc54021b420de888e1 (patch) | |
tree | 3c131e9a6e96d63c9d59a16721bcf780f03ee20e /ci/script.sh | |
parent | 10b8f7c79571400b592bfadcbb5a52873872b7e4 (diff) | |
parent | ab700367e724ce3576e2aa5cc3c94a36439c1541 (diff) | |
download | cast-b8f1071dd47cbf67c3d1c6bc54021b420de888e1.tar.gz |
Initial import of cast-0.2.3. am: 80f5cd0831 am: 46353a3021 am: f8edbc5cc4 am: ab700367e7
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cast/+/1620970
Change-Id: I53797effda716124e6b433eb4c232f1d96725fa7
Diffstat (limited to 'ci/script.sh')
-rw-r--r-- | ci/script.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ci/script.sh b/ci/script.sh new file mode 100644 index 0000000..12b2619 --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,43 @@ +set -euxo pipefail + +main() { + # not MSRV + if [ $TRAVIS_RUST_VERSION != 1.13.0 ]; then + cargo check --target $TARGET --no-default-features + + cargo test --features x128 --target $TARGET + cargo test --features x128 --target $TARGET --release + else + cargo build --target $TARGET --no-default-features + cargo build --target $TARGET + fi +} + +# fake Travis variables to be able to run this on a local machine +if [ -z ${TRAVIS_BRANCH-} ]; then + TRAVIS_BRANCH=staging +fi + +if [ -z ${TRAVIS_PULL_REQUEST-} ]; then + TRAVIS_PULL_REQUEST=false +fi + +if [ -z ${TRAVIS_RUST_VERSION-} ]; then + case $(rustc -V) in + *nightly*) + TRAVIS_RUST_VERSION=nightly + ;; + *beta*) + TRAVIS_RUST_VERSION=beta + ;; + *) + TRAVIS_RUST_VERSION=stable + ;; + esac +fi + +if [ -z ${TARGET-} ]; then + TARGET=$(rustc -Vv | grep host | cut -d ' ' -f2) +fi + +main |