|
| 1 | +language: rust |
| 2 | +sudo: false |
| 3 | + |
| 4 | +matrix: |
| 5 | + include: |
| 6 | + - rust: 1.28.0 |
| 7 | + env: DESCRIPTION="Linux, 1.28.0" |
| 8 | + os: linux |
| 9 | + |
| 10 | + - rust: 1.28.0 |
| 11 | + env: DESCRIPTION="OSX, 1.22.0" |
| 12 | + os: osx |
| 13 | + |
| 14 | + - rust: stable |
| 15 | + env: DESCRIPTION="Linux, stable" |
| 16 | + |
| 17 | + - rust: stable |
| 18 | + env: DESCRIPTION="OSX+iOS, stable" |
| 19 | + os: osx |
| 20 | + install: |
| 21 | + - rustup target add aarch64-apple-ios |
| 22 | + |
| 23 | + - rust: beta |
| 24 | + env: DESCRIPTION="Linux, beta" |
| 25 | + |
| 26 | + - rust: nightly |
| 27 | + os: linux |
| 28 | + env: DESCRIPTION="Linux, nightly, docs" |
| 29 | + install: |
| 30 | + - cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks |
| 31 | + - cargo deadlinks -V |
| 32 | + before_script: |
| 33 | + - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH |
| 34 | + script: |
| 35 | + # Differs from standard script: alloc feature, all features, doc build |
| 36 | + - cargo test --lib --no-default-features --features=alloc |
| 37 | + - cargo test --all-features |
| 38 | + - cargo test --benches --features=nightly |
| 39 | + - cargo test --examples |
| 40 | + - cargo test --manifest-path rand_core/Cargo.toml |
| 41 | + - cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc |
| 42 | + - cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1 |
| 43 | + - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 |
| 44 | + - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 |
| 45 | + - cargo test --manifest-path rand_xoshiro/Cargo.toml |
| 46 | + - cargo test --manifest-path rand_chacha/Cargo.toml |
| 47 | + - cargo test --manifest-path rand_hc/Cargo.toml |
| 48 | + - cargo test --manifest-path rand_jitter/Cargo.toml |
| 49 | + - cargo test --manifest-path rand_os/Cargo.toml |
| 50 | + # remove cached documentation, otherwise files from previous PRs can get included |
| 51 | + - rm -rf target/doc |
| 52 | + - cargo doc --no-deps --all --all-features |
| 53 | + - cargo deadlinks --dir target/doc |
| 54 | + after_success: |
| 55 | + - travis-cargo --only nightly doc-upload |
| 56 | + |
| 57 | + - rust: nightly |
| 58 | + os: osx |
| 59 | + env: DESCRIPTION="OSX, nightly, docs" |
| 60 | + install: |
| 61 | + - cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks |
| 62 | + - cargo deadlinks -V |
| 63 | + script: |
| 64 | + - cargo test |
| 65 | + - cargo test --benches |
| 66 | + - cargo test --examples |
| 67 | + # remove cached documentation, otherwise files from previous PRs can get included |
| 68 | + - rm -rf target/doc |
| 69 | + - cargo doc --no-deps --all --all-features |
| 70 | + - cargo deadlinks --dir target/doc |
| 71 | + |
| 72 | + - rust: nightly |
| 73 | + env: DESCRIPTION="WASM via emscripten, stdweb and wasm-bindgen" |
| 74 | + install: |
| 75 | + - rustup target add wasm32-unknown-unknown |
| 76 | + - rustup target add wasm32-unknown-emscripten |
| 77 | + - nvm install 9 |
| 78 | + - ./utils/ci/install_cargo_web.sh |
| 79 | + - cargo web prepare-emscripten |
| 80 | + - cargo web -V |
| 81 | + - cargo list | grep install-update || cargo install -f cargo-update |
| 82 | + - cargo install-update -i cargo-update wasm-bindgen-cli wasm-pack |
| 83 | + addons: |
| 84 | + chrome: stable |
| 85 | + script: |
| 86 | + # Testing wasm32-unknown-emscripten fails because of rust-lang/rust#49877 |
| 87 | + # However, we can still build and link all tests to make sure that works. |
| 88 | + # This is actually useful as it finds stuff such as rust-random/rand#669 |
| 89 | + - EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" cargo web test --target wasm32-unknown-emscripten --no-run |
| 90 | + #- cargo web test --target wasm32-unknown-emscripten |
| 91 | + #- cargo web test --nodejs --target wasm32-unknown-emscripten |
| 92 | + #- cargo build --target wasm32-unknown-unknown # without any features |
| 93 | + - cargo build --target wasm32-unknown-unknown --features=wasm-bindgen |
| 94 | + - cargo web test --target wasm32-unknown-unknown --features=stdweb |
| 95 | + - cargo build --manifest-path tests/wasm_bindgen/Cargo.toml --target wasm32-unknown-unknown |
| 96 | + - wasm-bindgen --nodejs target/wasm32-unknown-unknown/debug/rand_wasm_bindgen_test.wasm --out-dir tests/wasm_bindgen/js |
| 97 | + - node tests/wasm_bindgen/js/index.js |
| 98 | + - wasm-pack test --node tests/wasm_bindgen |
| 99 | + |
| 100 | + - rust: nightly |
| 101 | + env: DESCRIPTION="cross-platform build only" |
| 102 | + install: |
| 103 | + - rustup target add x86_64-sun-solaris |
| 104 | + - rustup target add x86_64-unknown-cloudabi |
| 105 | + - rustup target add x86_64-unknown-freebsd |
| 106 | + - rustup target add x86_64-unknown-fuchsia |
| 107 | + - rustup target add x86_64-unknown-netbsd |
| 108 | + - rustup target add x86_64-unknown-redox |
| 109 | + script: |
| 110 | + - cargo build --target=x86_64-sun-solaris --all-features |
| 111 | + - cargo build --target=x86_64-unknown-cloudabi --all-features |
| 112 | + - cargo build --target=x86_64-unknown-freebsd --all-features |
| 113 | + - cargo build --target=x86_64-unknown-fuchsia --all-features |
| 114 | + - cargo build --target=x86_64-unknown-netbsd --all-features |
| 115 | + - cargo build --target=x86_64-unknown-redox --all-features |
| 116 | + |
| 117 | + # Trust cross-built/emulated targets. We must repeat all non-default values. |
| 118 | + - rust: stable |
| 119 | + sudo: required |
| 120 | + dist: trusty |
| 121 | + services: docker |
| 122 | + env: DESCRIPTION="Linux (MIPS, big-endian)" TARGET=mips-unknown-linux-gnu |
| 123 | + install: |
| 124 | + - sh utils/ci/install.sh |
| 125 | + - source ~/.cargo/env || true |
| 126 | + script: |
| 127 | + - bash utils/ci/script.sh |
| 128 | + |
| 129 | + - rust: stable |
| 130 | + sudo: required |
| 131 | + dist: trusty |
| 132 | + services: docker |
| 133 | + env: DESCRIPTION="Android (ARMv7)" TARGET=armv7-linux-androideabi |
| 134 | + install: |
| 135 | + - sh utils/ci/install.sh |
| 136 | + - source ~/.cargo/env || true |
| 137 | + script: |
| 138 | + - bash utils/ci/script.sh |
| 139 | + |
| 140 | +before_install: |
| 141 | + - set -e |
| 142 | + - rustup self update |
| 143 | + |
| 144 | +script: |
| 145 | + - cargo test |
| 146 | + - cargo test --benches |
| 147 | + - cargo test --examples |
| 148 | + |
| 149 | +after_script: set +e |
| 150 | + |
| 151 | +cache: |
| 152 | + cargo: true |
| 153 | + directories: |
| 154 | + - .local/share/cargo-web |
| 155 | + |
| 156 | +before_cache: |
| 157 | + # Travis can't cache files that are not readable by "others" |
| 158 | + - chmod -R a+r $HOME/.cargo |
| 159 | + |
| 160 | +notifications: |
| 161 | + email: |
| 162 | + on_success: never |
0 commit comments