sudo: required
language: rust
branches:
only:
- master
matrix:
fast_finish: true
include:
- rust: nightly
- rust: beta
- rust: stable
install: |
if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then
# see also https://github.com/xd009642/tarpaulin/issues/150 for tarpaulin nightly dependency
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin -f
# should only be necessary until rustfmt produces consistent results in stable/nightly
rustup component add rustfmt
fi
script:
- |
if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then
cargo fmt --all -- --check
fi
- cargo test
cache:
directories:
- /home/travis/.cargo
before_cache:
- rm -rf /home/travis/.cargo/registry
addons:
apt:
packages:
- libssl-dev
after_success:
- '[ $TRAVIS_EVENT_TYPE != "cron" ] &&
[ $TRAVIS_RUST_VERSION = stable ] &&
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
cargo +nightly tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID || true'
- '[ $TRAVIS_RUST_VERSION = stable ] &&
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ]
&& cargo doc --no-deps &&
echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d / -f 2`/index.html>" > target/doc/index.html'
deploy:
provider: pages
skip-cleanup: true
github-token: $GH_TOKEN
local-dir: target/doc
keep-history: false
on:
branch: master
condition: $TRAVIS_RUST_VERSION = stable