forked from rust-random/getrandom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
180 lines (161 loc) · 6.34 KB
/
.travis.yml
File metadata and controls
180 lines (161 loc) · 6.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
language: rust
sudo: false
matrix:
include:
- rust: 1.32.0
env: DESCRIPTION="Linux, 1.32.0"
os: linux
- rust: 1.32.0
env: DESCRIPTION="OSX, 1.32.0"
os: osx
- rust: stable
env: DESCRIPTION="Linux, stable"
- rust: stable
env: DESCRIPTION="OSX+iOS, stable"
os: osx
install:
- rustup target add aarch64-apple-ios
- rust: beta
env: DESCRIPTION="Linux, beta"
- rust: stable
env: DESCRIPTION="Rustfmt"
install:
- rustup component add rustfmt
script:
- cargo fmt --all -- src/*.rs --check
- rust: nightly
os: linux
env: DESCRIPTION="Linux, nightly, docs"
install:
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
- cargo deadlinks -V
script:
- cargo test
- cargo test --benches
- cargo test --examples
# remove cached documentation, otherwise files from previous PRs can get included
- rm -rf target/doc
- cargo doc --no-deps --all --all-features
- cargo deadlinks --dir target/doc
# also test minimum dependency versions are usable
- cargo generate-lockfile -Z minimal-versions
- cargo test
- rust: nightly
os: osx
env: DESCRIPTION="OSX, nightly, docs"
install:
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
- cargo deadlinks -V
script:
- cargo test
- cargo test --benches
- cargo test --examples
# remove cached documentation, otherwise files from previous PRs can get included
- rm -rf target/doc
- cargo doc --no-deps --all --all-features
- cargo deadlinks --dir target/doc
# also test minimum dependency versions are usable
- cargo generate-lockfile -Z minimal-versions
- cargo test
- rust: nightly
env: DESCRIPTION="WASM via emscripten, stdweb, wasm-bindgen and WASI"
install:
- rustup target add wasm32-unknown-unknown
- rustup target add wasm32-unknown-emscripten
- rustup target add wasm32-wasi
- nvm install 9
- ./utils/ci/install_cargo_web.sh
- cargo web prepare-emscripten
- cargo web -V
- cargo list | grep install-update || cargo install -f cargo-update
- cargo install-update -i cargo-update wasm-bindgen-cli wasm-pack
addons:
chrome: stable
script:
# Testing wasm32-unknown-emscripten fails because of rust-lang/rust#49877
# However, we can still build and link all tests to make sure that works.
# This is actually useful as it finds stuff such as rust-random/rand#669
- EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" cargo web test --target wasm32-unknown-emscripten --no-run
#- cargo web test --target wasm32-unknown-emscripten
#- cargo web test --nodejs --target wasm32-unknown-emscripten
#- cargo build --target wasm32-unknown-unknown # without any features
- cargo build --target wasm32-wasi
- cargo build --target wasm32-unknown-unknown --features=wasm-bindgen
- cargo web test --target wasm32-unknown-unknown --features=stdweb
- cargo build --manifest-path tests/wasm_bindgen/Cargo.toml --target wasm32-unknown-unknown
- wasm-bindgen --nodejs target/wasm32-unknown-unknown/debug/getrandom_wasm_bindgen_test.wasm --out-dir tests/wasm_bindgen/js
- node tests/wasm_bindgen/js/index.js
- wasm-pack test --node tests/wasm_bindgen
- rust: nightly
env: DESCRIPTION="cross-platform build only"
install:
- rustup target add x86_64-sun-solaris
- rustup target add x86_64-unknown-cloudabi
- rustup target add x86_64-unknown-freebsd
#- rustup target add x86_64-unknown-fuchsia
- rustup target add x86_64-unknown-netbsd
- rustup target add x86_64-unknown-redox
- rustup target add x86_64-fortanix-unknown-sgx
# For no_std targets
- rustup component add rust-src
- cargo install cargo-xbuild || true
script:
- cargo build --target=x86_64-sun-solaris --all-features
- cargo build --target=x86_64-unknown-cloudabi --all-features
- cargo build --target=x86_64-unknown-freebsd --all-features
#- cargo build --target=x86_64-unknown-fuchsia --all-features
- cargo build --target=x86_64-unknown-netbsd --all-features
- cargo build --target=x86_64-unknown-redox --all-features
- cargo build --target=x86_64-fortanix-unknown-sgx --all-features
- cargo xbuild --target=x86_64-unknown-uefi
# also test minimum dependency versions are usable
- cargo generate-lockfile -Z minimal-versions
- cargo build --target=x86_64-sun-solaris --all-features
- cargo build --target=x86_64-unknown-cloudabi --all-features
- cargo build --target=x86_64-unknown-freebsd --all-features
#- cargo build --target=x86_64-unknown-fuchsia --all-features
- cargo build --target=x86_64-unknown-netbsd --all-features
- cargo build --target=x86_64-unknown-redox --all-features
- cargo build --target=x86_64-fortanix-unknown-sgx --all-features
- cargo xbuild --target=x86_64-unknown-uefi
# Trust cross-built/emulated targets. We must repeat all non-default values.
- rust: stable
sudo: required
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
allow_failures:
# Formatting errors should appear in Travis, but not break the build.
- env: DESCRIPTION="Rustfmt"
before_install:
- set -e
- rustup self update
script:
- cargo test
- cargo test --examples
after_script: set +e
cache:
cargo: true
directories:
- .local/share/cargo-web
before_cache:
# Travis can't cache files that are not readable by "others"
- chmod -R a+r $HOME/.cargo
notifications:
email:
on_success: never