Skip to content

Commit

Permalink
Revise CI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Oct 15, 2018
1 parent d322954 commit 905e255
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 77 deletions.
86 changes: 39 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,64 +51,38 @@ 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
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)"
os: osx
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"
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
41 changes: 11 additions & 30 deletions utils/ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 905e255

Please sign in to comment.