Skip to content

Commit 7cc7a3d

Browse files
committed
ci: Improve testing and doc generation
- Remove use of `--examples`, we do not have examples - Install drivers to $HOME - Use YAML expansion to avoid repeating testing configs - Make sure crates build with each feature set individually - Add missing targets to cross-platform build step - Check minimum version compatiblity with features _on_ - Gerate docs with "std" feature set
1 parent 345ee50 commit 7cc7a3d

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

.travis.yml

+16-26
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ matrix:
2121
- rustup target add aarch64-apple-ios
2222
script:
2323
- cargo test
24-
- cargo test --examples
2524
- cargo build --target aarch64-apple-ios
2625

2726
- name: "Linux, beta"
@@ -40,11 +39,11 @@ matrix:
4039
# Get latest geckodriver
4140
- export VERSION=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r ".tag_name")
4241
- wget -O geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/$VERSION/geckodriver-$VERSION-linux64.tar.gz
43-
- tar -xzf geckodriver.tar.gz
42+
- tar -xzf geckodriver.tar.gz -C $HOME
4443
# Get latest chromedirver
4544
- export VERSION=$(wget -q -O - https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
4645
- wget -O chromedriver.zip https://chromedriver.storage.googleapis.com/$VERSION/chromedriver_linux64.zip
47-
- unzip chromedriver.zip
46+
- unzip chromedriver.zip -d $HOME
4847
# Get cargo-web
4948
- export VERSION=0.6.26 # Pin version for stability
5049
- wget -O cargo-web.gz https://github.com/koute/cargo-web/releases/download/$VERSION/cargo-web-x86_64-unknown-linux-gnu.gz
@@ -76,44 +75,34 @@ matrix:
7675
- cargo web test --target=wasm32-unknown-unknown --features=stdweb
7776
# wasm-bindgen tests (Node, Firefox, Chrome)
7877
- cargo test --target wasm32-unknown-unknown --features=wasm-bindgen
79-
- GECKODRIVER=$PWD/geckodriver cargo test --target wasm32-unknown-unknown --features=test-in-browser
80-
- CHROMEDRIVER=$PWD/chromedriver cargo test --target wasm32-unknown-unknown --features=test-in-browser
78+
- GECKODRIVER=$HOME/geckodriver cargo test --target wasm32-unknown-unknown --features=test-in-browser
79+
- CHROMEDRIVER=$HOME/chromedriver cargo test --target wasm32-unknown-unknown --features=test-in-browser
8180

82-
- name: "Linux, nightly, docs"
81+
- &nightly_and_docs
82+
name: "Linux, nightly, docs"
8383
rust: nightly
8484
os: linux
8585
install:
8686
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
8787
- cargo deadlinks -V
8888
script:
89+
# Check that our tests pass in the default configuration
8990
- cargo test
9091
- cargo test --benches
91-
- cargo test --examples
92+
# Check that setting various features does not break the build
93+
- cargo build --features=std
94+
- cargo build --features=log
9295
# remove cached documentation, otherwise files from previous PRs can get included
9396
- rm -rf target/doc
94-
- cargo doc --no-deps --all --features=std,log
97+
- cargo doc --no-deps --features=std
9598
- cargo deadlinks --dir target/doc
9699
# also test minimum dependency versions are usable
97100
- cargo generate-lockfile -Z minimal-versions
98-
- cargo test
101+
- cargo test --features=std,log
99102

100-
- name: "OSX, nightly, docs"
101-
rust: nightly
103+
- <<: *nightly_and_docs
104+
name: "OSX, nightly, docs"
102105
os: osx
103-
install:
104-
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
105-
- cargo deadlinks -V
106-
script:
107-
- cargo test
108-
- cargo test --benches
109-
- cargo test --examples
110-
# remove cached documentation, otherwise files from previous PRs can get included
111-
- rm -rf target/doc
112-
- cargo doc --no-deps --all --features=std,log
113-
- cargo deadlinks --dir target/doc
114-
# also test minimum dependency versions are usable
115-
- cargo generate-lockfile -Z minimal-versions
116-
- cargo test
117106

118107
- name: "cross-platform build only"
119108
rust: nightly
@@ -139,6 +128,7 @@ matrix:
139128
- cargo xbuild --target=x86_64-unknown-uefi
140129
- cargo xbuild --target=x86_64-unknown-hermit
141130
- cargo xbuild --target=x86_64-unknown-l4re-uclibc
131+
- cargo xbuild --target=x86_64-uwp-windows-gnu
142132
- cargo xbuild --target=x86_64-wrs-vxworks
143133
# also test minimum dependency versions are usable
144134
- cargo generate-lockfile -Z minimal-versions
@@ -153,6 +143,7 @@ matrix:
153143
- cargo xbuild --target=x86_64-unknown-hermit
154144
- cargo xbuild --target=x86_64-unknown-l4re-uclibc
155145
- cargo xbuild --target=x86_64-uwp-windows-gnu
146+
- cargo xbuild --target=x86_64-wrs-vxworks
156147

157148
# Trust cross-built/emulated targets. We must repeat all non-default values.
158149
- name: "Linux (MIPS, big-endian)"
@@ -199,7 +190,6 @@ before_script:
199190

200191
script:
201192
- cargo test
202-
- cargo test --examples
203193

204194
after_script: set +e
205195

0 commit comments

Comments
 (0)