From 905e2552844734cebe8dc0abd29d2037d989655f Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Mon, 15 Oct 2018 11:05:15 +0100 Subject: [PATCH] Revise CI scripts --- .travis.yml | 86 +++++++++++++++++++++------------------------- appveyor.yml | 7 ++++ utils/ci/script.sh | 41 ++++++---------------- 3 files changed, 57 insertions(+), 77 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36fadafa987..0b863e6c26d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,13 +51,8 @@ sudo: false # - run benchmarks as tests: # `cargo test --benches --features=nightly` # Tests on subcrates: -# `cargo test --package rand_core` -# `cargo test --package rand_core --features=alloc` (requires nightly) -# `cargo test --package rand_core --no-default-features` -# `cargo test --package rand_isaac --features=serde1` -# `cargo test --package rand_xorshift --features=serde1` -# `cargo test --package rand_chacha` -# `cargo test --package rand_hc128` +# - select crates via --manifest-path (more reliable than --package) +# - test appropriate feature matrix # # TODO: SIMD support on stable releases # NOTE: SIMD support is unreliable on nightly; we track the latest release @@ -65,17 +60,6 @@ matrix: include: - rust: 1.22.0 env: DESCRIPTION="pinned stable Rust release" - install: - script: - - cargo test --lib --no-default-features - - cargo test --features=serde1,log - - cargo test --examples - - cargo test --package rand_core - - cargo test --package rand_core --no-default-features - - cargo test --package rand_isaac --features=serde1 - # - cargo test --package rand_xorshift --features=serde1 - - cargo test --package rand_chacha - - cargo test --package rand_hc128 - rust: stable env: DESCRIPTION="stable Rust release, macOS, iOS (cross-compile only)" @@ -83,32 +67,22 @@ matrix: install: - rustup target add aarch64-apple-ios script: + # Differs from standard script: includes aarch64-apple-ios cross-build - cargo test --lib --no-default-features # TODO: add simd_support feature: - cargo test --features=serde1,log - cargo test --examples - - cargo test --package rand_core - - cargo test --package rand_core --no-default-features - - cargo test --package rand_isaac --features=serde1 - - cargo test --package rand_xorshift --features=serde1 - - cargo test --package rand_chacha - - cargo test --package rand_hc128 + - cargo test --manifest-path rand_core/Cargo.toml + - cargo test --manifest-path rand_core/Cargo.toml --no-default-features + - cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_chacha/Cargo.toml + - cargo test --manifest-path rand_hc128/Cargo.toml - cargo build --target=aarch64-apple-ios - rust: beta env: DESCRIPTION="beta Rust release" - install: - script: - - cargo test --lib --no-default-features - # TODO: add simd_support feature: - - cargo test --features=serde1,log - - cargo test --examples - - cargo test --package rand_core - - cargo test --package rand_core --no-default-features - - cargo test --package rand_isaac --features=serde1 - - cargo test --package rand_xorshift --features=serde1 - - cargo test --package rand_chacha - - cargo test --package rand_hc128 - rust: nightly env: DESCRIPTION="nightly features, benchmarks, documentation" @@ -118,16 +92,18 @@ matrix: before_script: - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH script: + # Differs from standard script: alloc feature, all features, doc build - cargo test --lib --no-default-features --features=alloc - cargo test --all-features - cargo test --benches --features=nightly - cargo test --examples - - cargo test --package rand_core - - cargo test --package rand_core --no-default-features --features=alloc - - cargo test --package rand_isaac --features=serde1 - # - cargo test --package rand_xorshift --features=serde1 - - cargo test --package rand_chacha - - cargo test --package rand_hc128 + - cargo test --manifest-path rand_core/Cargo.toml + - cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc + - cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_chacha/Cargo.toml + - cargo test --manifest-path rand_hc128/Cargo.toml # remove cached documentation, otherwise files from previous PRs can get included - rm -rf target/doc - cargo doc --no-deps --all --all-features @@ -179,22 +155,38 @@ matrix: dist: trusty services: docker env: DESCRIPTION="Linux (MIPS, big-endian)" TARGET=mips-unknown-linux-gnu + install: + - sh utils/ci/install.sh + - source ~/.cargo/env || true + script: + - bash utils/ci/script.sh - rust: stable sudo: required dist: trusty services: docker env: DESCRIPTION="Android (ARMv7)" TARGET=armv7-linux-androideabi + install: + - sh utils/ci/install.sh + - source ~/.cargo/env || true + script: + - bash utils/ci/script.sh before_install: - set -e - rustup self update -# Used by all Trust targets; others must override: -install: - - sh utils/ci/install.sh - - source ~/.cargo/env || true script: - - bash utils/ci/script.sh + - cargo test --lib --no-default-features + # TODO: add simd_support feature: + - cargo test --features=serde1,log + - cargo test --examples + - cargo test --manifest-path rand_core/Cargo.toml + - cargo test --manifest-path rand_core/Cargo.toml --no-default-features + - cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_chacha/Cargo.toml + - cargo test --manifest-path rand_hc128/Cargo.toml after_script: set +e diff --git a/appveyor.yml b/appveyor.yml index 3ac30f41e1a..67c972e91e6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -43,3 +43,10 @@ test_script: - cargo test --package rand_xorshift --features=serde1 - cargo test --package rand_chacha - cargo test --package rand_hc128 + - cargo test --manifest-path rand_core/Cargo.toml + - cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc + - cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 + - cargo test --manifest-path rand_chacha/Cargo.toml + - cargo test --manifest-path rand_hc128/Cargo.toml diff --git a/utils/ci/script.sh b/utils/ci/script.sh index cd55885b2dc..fd85645cd5e 100644 --- a/utils/ci/script.sh +++ b/utils/ci/script.sh @@ -3,36 +3,17 @@ set -ex main() { - if [ ! -z $DISABLE_TESTS ]; then # tests are disabled - cross build --no-default-features --target $TARGET --release - if [ -z $DISABLE_STD ]; then # std is enabled - cross build --features log,serde1 --target $TARGET - fi - return - fi - - if [ ! -z $NIGHTLY ]; then # have nightly Rust - cross test --lib --no-default-features --features alloc --target $TARGET - cross test --all-features --target $TARGET - cross test --benches --features=nightly --target $TARGET - cross test --examples --target $TARGET - cross test --package rand_core --target $TARGET - cross test --package rand_core --no-default-features --features=alloc --target $TARGET - cross test --package rand_isaac --features=serde1 --target $TARGET - cross test --package rand_chacha --target $TARGET - cross test --package rand_hc128 --target $TARGET - cross test --package rand_xorshift --features=serde1 --target $TARGET - else # have stable Rust - cross test --lib --no-default-features --target $TARGET - cross test --features=serde1,log --target $TARGET - cross test --examples --target $TARGET - cross test --package rand_core --target $TARGET - cross test --package rand_core --no-default-features --target $TARGET - cross test --package rand_isaac --features=serde1 --target $TARGET - cross test --package rand_chacha --target $TARGET - # cross test --package rand_hc128 ---target $TARGET # fails for unknown reasons - cross test --package rand_xorshift --features=serde1 --target $TARGET - fi + cross test --target $TARGET --lib --no-default-features + # TODO: add simd_support feature: + cross test --target $TARGET --features=serde1,log + cross test --target $TARGET --examples + cross test --target $TARGET --manifest-path rand_core/Cargo.toml + cross test --target $TARGET --manifest-path rand_core/Cargo.toml --no-default-features + cross test --target $TARGET --manifest-path rand_isaac/Cargo.toml --features=serde1 + cross test --target $TARGET --manifest-path rand_pcg/Cargo.toml --features=serde1 + cross test --target $TARGET --manifest-path rand_xorshift/Cargo.toml --features=serde1 + cross test --target $TARGET --manifest-path rand_chacha/Cargo.toml + cross test --target $TARGET --manifest-path rand_hc128/Cargo.toml } # we don't run the "test phase" when doing deploys