Skip to content

Commit 905e255

Browse files
committed
Revise CI scripts
1 parent d322954 commit 905e255

File tree

3 files changed

+57
-77
lines changed

3 files changed

+57
-77
lines changed

.travis.yml

Lines changed: 39 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -51,64 +51,38 @@ sudo: false
5151
# - run benchmarks as tests:
5252
# `cargo test --benches --features=nightly`
5353
# Tests on subcrates:
54-
# `cargo test --package rand_core`
55-
# `cargo test --package rand_core --features=alloc` (requires nightly)
56-
# `cargo test --package rand_core --no-default-features`
57-
# `cargo test --package rand_isaac --features=serde1`
58-
# `cargo test --package rand_xorshift --features=serde1`
59-
# `cargo test --package rand_chacha`
60-
# `cargo test --package rand_hc128`
54+
# - select crates via --manifest-path (more reliable than --package)
55+
# - test appropriate feature matrix
6156
#
6257
# TODO: SIMD support on stable releases
6358
# NOTE: SIMD support is unreliable on nightly; we track the latest release
6459
matrix:
6560
include:
6661
- rust: 1.22.0
6762
env: DESCRIPTION="pinned stable Rust release"
68-
install:
69-
script:
70-
- cargo test --lib --no-default-features
71-
- cargo test --features=serde1,log
72-
- cargo test --examples
73-
- cargo test --package rand_core
74-
- cargo test --package rand_core --no-default-features
75-
- cargo test --package rand_isaac --features=serde1
76-
# - cargo test --package rand_xorshift --features=serde1
77-
- cargo test --package rand_chacha
78-
- cargo test --package rand_hc128
7963

8064
- rust: stable
8165
env: DESCRIPTION="stable Rust release, macOS, iOS (cross-compile only)"
8266
os: osx
8367
install:
8468
- rustup target add aarch64-apple-ios
8569
script:
70+
# Differs from standard script: includes aarch64-apple-ios cross-build
8671
- cargo test --lib --no-default-features
8772
# TODO: add simd_support feature:
8873
- cargo test --features=serde1,log
8974
- cargo test --examples
90-
- cargo test --package rand_core
91-
- cargo test --package rand_core --no-default-features
92-
- cargo test --package rand_isaac --features=serde1
93-
- cargo test --package rand_xorshift --features=serde1
94-
- cargo test --package rand_chacha
95-
- cargo test --package rand_hc128
75+
- cargo test --manifest-path rand_core/Cargo.toml
76+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features
77+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
78+
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
79+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
80+
- cargo test --manifest-path rand_chacha/Cargo.toml
81+
- cargo test --manifest-path rand_hc128/Cargo.toml
9682
- cargo build --target=aarch64-apple-ios
9783

9884
- rust: beta
9985
env: DESCRIPTION="beta Rust release"
100-
install:
101-
script:
102-
- cargo test --lib --no-default-features
103-
# TODO: add simd_support feature:
104-
- cargo test --features=serde1,log
105-
- cargo test --examples
106-
- cargo test --package rand_core
107-
- cargo test --package rand_core --no-default-features
108-
- cargo test --package rand_isaac --features=serde1
109-
- cargo test --package rand_xorshift --features=serde1
110-
- cargo test --package rand_chacha
111-
- cargo test --package rand_hc128
11286

11387
- rust: nightly
11488
env: DESCRIPTION="nightly features, benchmarks, documentation"
@@ -118,16 +92,18 @@ matrix:
11892
before_script:
11993
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
12094
script:
95+
# Differs from standard script: alloc feature, all features, doc build
12196
- cargo test --lib --no-default-features --features=alloc
12297
- cargo test --all-features
12398
- cargo test --benches --features=nightly
12499
- cargo test --examples
125-
- cargo test --package rand_core
126-
- cargo test --package rand_core --no-default-features --features=alloc
127-
- cargo test --package rand_isaac --features=serde1
128-
# - cargo test --package rand_xorshift --features=serde1
129-
- cargo test --package rand_chacha
130-
- cargo test --package rand_hc128
100+
- cargo test --manifest-path rand_core/Cargo.toml
101+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc
102+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
103+
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
104+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
105+
- cargo test --manifest-path rand_chacha/Cargo.toml
106+
- cargo test --manifest-path rand_hc128/Cargo.toml
131107
# remove cached documentation, otherwise files from previous PRs can get included
132108
- rm -rf target/doc
133109
- cargo doc --no-deps --all --all-features
@@ -179,22 +155,38 @@ matrix:
179155
dist: trusty
180156
services: docker
181157
env: DESCRIPTION="Linux (MIPS, big-endian)" TARGET=mips-unknown-linux-gnu
158+
install:
159+
- sh utils/ci/install.sh
160+
- source ~/.cargo/env || true
161+
script:
162+
- bash utils/ci/script.sh
182163
- rust: stable
183164
sudo: required
184165
dist: trusty
185166
services: docker
186167
env: DESCRIPTION="Android (ARMv7)" TARGET=armv7-linux-androideabi
168+
install:
169+
- sh utils/ci/install.sh
170+
- source ~/.cargo/env || true
171+
script:
172+
- bash utils/ci/script.sh
187173

188174
before_install:
189175
- set -e
190176
- rustup self update
191177

192-
# Used by all Trust targets; others must override:
193-
install:
194-
- sh utils/ci/install.sh
195-
- source ~/.cargo/env || true
196178
script:
197-
- bash utils/ci/script.sh
179+
- cargo test --lib --no-default-features
180+
# TODO: add simd_support feature:
181+
- cargo test --features=serde1,log
182+
- cargo test --examples
183+
- cargo test --manifest-path rand_core/Cargo.toml
184+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features
185+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
186+
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
187+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
188+
- cargo test --manifest-path rand_chacha/Cargo.toml
189+
- cargo test --manifest-path rand_hc128/Cargo.toml
198190

199191
after_script: set +e
200192

appveyor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,10 @@ test_script:
4343
- cargo test --package rand_xorshift --features=serde1
4444
- cargo test --package rand_chacha
4545
- cargo test --package rand_hc128
46+
- cargo test --manifest-path rand_core/Cargo.toml
47+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc
48+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
49+
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
50+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
51+
- cargo test --manifest-path rand_chacha/Cargo.toml
52+
- cargo test --manifest-path rand_hc128/Cargo.toml

utils/ci/script.sh

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,17 @@
33
set -ex
44

55
main() {
6-
if [ ! -z $DISABLE_TESTS ]; then # tests are disabled
7-
cross build --no-default-features --target $TARGET --release
8-
if [ -z $DISABLE_STD ]; then # std is enabled
9-
cross build --features log,serde1 --target $TARGET
10-
fi
11-
return
12-
fi
13-
14-
if [ ! -z $NIGHTLY ]; then # have nightly Rust
15-
cross test --lib --no-default-features --features alloc --target $TARGET
16-
cross test --all-features --target $TARGET
17-
cross test --benches --features=nightly --target $TARGET
18-
cross test --examples --target $TARGET
19-
cross test --package rand_core --target $TARGET
20-
cross test --package rand_core --no-default-features --features=alloc --target $TARGET
21-
cross test --package rand_isaac --features=serde1 --target $TARGET
22-
cross test --package rand_chacha --target $TARGET
23-
cross test --package rand_hc128 --target $TARGET
24-
cross test --package rand_xorshift --features=serde1 --target $TARGET
25-
else # have stable Rust
26-
cross test --lib --no-default-features --target $TARGET
27-
cross test --features=serde1,log --target $TARGET
28-
cross test --examples --target $TARGET
29-
cross test --package rand_core --target $TARGET
30-
cross test --package rand_core --no-default-features --target $TARGET
31-
cross test --package rand_isaac --features=serde1 --target $TARGET
32-
cross test --package rand_chacha --target $TARGET
33-
# cross test --package rand_hc128 ---target $TARGET # fails for unknown reasons
34-
cross test --package rand_xorshift --features=serde1 --target $TARGET
35-
fi
6+
cross test --target $TARGET --lib --no-default-features
7+
# TODO: add simd_support feature:
8+
cross test --target $TARGET --features=serde1,log
9+
cross test --target $TARGET --examples
10+
cross test --target $TARGET --manifest-path rand_core/Cargo.toml
11+
cross test --target $TARGET --manifest-path rand_core/Cargo.toml --no-default-features
12+
cross test --target $TARGET --manifest-path rand_isaac/Cargo.toml --features=serde1
13+
cross test --target $TARGET --manifest-path rand_pcg/Cargo.toml --features=serde1
14+
cross test --target $TARGET --manifest-path rand_xorshift/Cargo.toml --features=serde1
15+
cross test --target $TARGET --manifest-path rand_chacha/Cargo.toml
16+
cross test --target $TARGET --manifest-path rand_hc128/Cargo.toml
3617
}
3718

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

0 commit comments

Comments
 (0)