forked from graphprotocol/rust-web3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (50 loc) · 2.21 KB
/
.travis.yml
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
sudo: false
language: rust
branches:
only:
- master
cache:
# Don't use `cache: cargo` since it adds the `target` directory and that can be huge.
# Saving and loading this directory dwarfes actual compilation and test times. But what is more
# important, is that travis timeouts the build since the job doesn't produce any output for more
# than 10 minutes.
#
# So we just cache ~/.cargo directory
directories:
- /home/travis/.cargo
before_cache:
# Travis can't cache files that are not readable by "others"
- chmod -R a+r $HOME/.cargo
# According to the Travis CI docs for building Rust project this is done by,
- rm -rf /home/travis/.cargo/registry
matrix:
fast_finish: false
allow_failures:
- rust: nightly
include:
- rust: stable
- rust: beta
- rust: nightly
before_script:
- if [[ "${TRAVIS_RUST_VERSION}" == stable ]]; then
rustup component add rustfmt && cargo install cargo-deny;
fi
script:
- if [[ "${TRAVIS_RUST_VERSION}" == "stable" ]]; then
cargo fmt -- --check && cargo deny check;
fi
- cargo check
- cargo build
- cargo test
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
[ $TRAVIS_RUST_VERSION = stable ] &&
cargo doc $TARGETS --no-deps &&
echo '<meta http-equiv=refresh content=0;url=web3/index.html>' > target/doc/index.html &&
pip install --user ghp-import &&
/home/travis/.local/bin/ghp-import -n target/doc &&
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
env:
global:
- secure: "Utb5IjVdLpoxolqzMvARIXyi0Sf81z4sJMub4IWfdGANjt5VhFPYDr5KjXIy8RPtRYBi9NcMI32Oq6HHWkCHUO3OFKE9xcAP/SKirFc7gV1EzjAyUrEVfr4erk0d45kHlnt56W5HkQTBuzzmzJOajUKlrsPkArAHPNSa25eeOKhXrhLpShB2oUM5tTuJXIcB/AnmjEAOMRWEdH3v6m9JS3XewFUoT8ENSxf0ln8GMbQmLWh1+xSW3V7SiNL4+/xdnmKJMQ6qhme4e0fjRwFfHXSGHaR3YfA9gPjI8enoPNNdl1bLgHOWw+v1TjDp8qOd5pKL+yRjqoZdkalSAoD/UnkH9OFLwOfhsQyU9IllO00ue7Nc9Nh45gneVnYq02MKslVlv+gHg87yVAPnOXg7lFHF4Jed5A9qPOUIjHDAwoFEgvGsFQAEUiWCJcOaRn7TrHWnJ/tk3kpXTUT3hvUD2HuT5EwGPzvF3m8Y58j/127EXBNTYVwal4JJDzNd6AVdmQs1KMTxha1nbiVwwKhLZvqSfdqgeDrKI5VbRsv0tkuHbUBkEI60s7aC0NH1u6MvrpfR3pUWcH4DapLc47ngF3NMV0dYL/k7k1erGls4l2++b4gtbtLSPcXQpgXNn2zGNewjLVlXd0/326U5IuQP40zOglzltUT2HYC2FvMIiAI="