2017-09-03 14:31:15 +00:00
|
|
|
language: rust
|
2016-03-07 23:13:49 +00:00
|
|
|
|
2019-05-06 21:41:44 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- "$HOME/.cargo"
|
|
|
|
- "$HOME/.cache/sccache"
|
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- CRATE_NAME=mdbook
|
|
|
|
|
2019-02-03 23:45:02 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- rust: stable
|
|
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
|
|
|
- rust: beta
|
|
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
|
|
|
- rust: nightly
|
|
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
2019-06-20 19:04:55 +00:00
|
|
|
- rust: 1.34.0 # Minimum required Rust version
|
|
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
2018-08-21 16:18:20 +00:00
|
|
|
|
2019-02-03 23:45:02 +00:00
|
|
|
- rust: stable
|
|
|
|
os: osx
|
|
|
|
env: TARGET=x86_64-apple-darwin
|
2018-08-21 16:18:20 +00:00
|
|
|
|
2019-05-06 21:41:44 +00:00
|
|
|
before_install:
|
2019-06-21 05:06:51 +00:00
|
|
|
- |
|
|
|
|
export RUSTC_WRAPPER=sccache;
|
|
|
|
cd "$(mktemp -d)";
|
|
|
|
case "$TRAVIS_OS_NAME" in
|
2019-05-06 21:41:44 +00:00
|
|
|
linux )
|
2019-06-21 05:06:51 +00:00
|
|
|
travis_retry curl -sSL 'https://github.com/mozilla/sccache/releases/download/0.2.9/sccache-0.2.9-x86_64-unknown-linux-musl.tar.gz' | tar -xzf - --strip-components=1 &&
|
|
|
|
sudo cp sccache /usr/local/bin/sccache;
|
2019-05-06 21:41:44 +00:00
|
|
|
;;
|
|
|
|
osx )
|
2019-06-21 05:06:51 +00:00
|
|
|
travis_retry curl -sSL 'https://github.com/mozilla/sccache/releases/download/0.2.9/sccache-0.2.9-x86_64-apple-darwin.tar.gz' | tar -xzf - --strip-components=1 &&
|
|
|
|
sudo cp sccache /usr/local/bin/sccache;
|
2019-05-06 21:41:44 +00:00
|
|
|
;;
|
|
|
|
* ) unset RUSTC_WRAPPER;;
|
2019-06-21 05:06:51 +00:00
|
|
|
esac;
|
|
|
|
cd "$TRAVIS_BUILD_DIR";
|
2016-03-07 23:13:49 +00:00
|
|
|
|
2017-09-03 14:44:49 +00:00
|
|
|
script:
|
2018-08-21 16:18:20 +00:00
|
|
|
- cargo test --all
|
|
|
|
- cargo test --all --no-default-features
|
2019-06-21 05:06:51 +00:00
|
|
|
- |
|
|
|
|
if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then
|
2019-06-28 16:14:26 +00:00
|
|
|
rustup component add rustfmt && \
|
2019-05-08 19:20:38 +00:00
|
|
|
cargo fmt --all -- --check;
|
|
|
|
fi
|
2017-09-03 14:44:49 +00:00
|
|
|
|
2016-03-07 23:13:49 +00:00
|
|
|
before_deploy:
|
2019-05-15 22:50:01 +00:00
|
|
|
- cargo run -- build book-example
|
2018-04-07 07:47:08 +00:00
|
|
|
- sh ci/before_deploy.sh
|
2016-03-07 23:13:49 +00:00
|
|
|
|
|
|
|
deploy:
|
2019-05-15 22:50:01 +00:00
|
|
|
- provider: releases
|
|
|
|
api_key: "$GITHUB_TOKEN"
|
2017-12-30 11:15:17 +00:00
|
|
|
file_glob: true
|
|
|
|
file: "$CRATE_NAME-$TRAVIS_TAG-$TARGET.*"
|
2016-03-07 23:13:49 +00:00
|
|
|
on:
|
2017-12-30 11:15:17 +00:00
|
|
|
condition: "$TRAVIS_RUST_VERSION = stable"
|
2016-03-07 23:13:49 +00:00
|
|
|
tags: true
|
2017-12-30 11:15:17 +00:00
|
|
|
skip_cleanup: true
|
2019-05-15 22:50:01 +00:00
|
|
|
- provider: pages
|
|
|
|
local_dir: book-example/book
|
|
|
|
skip_cleanup: true
|
|
|
|
github_token: "$GITHUB_TOKEN"
|
2019-06-21 05:17:03 +00:00
|
|
|
keep_history: false
|
2019-05-15 22:50:01 +00:00
|
|
|
on:
|
|
|
|
condition: $TRAVIS_OS_NAME = "linux" && $TRAVIS_RUST_VERSION = "stable"
|
|
|
|
tags: true
|
2017-12-30 11:15:17 +00:00
|
|
|
|
|
|
|
branches:
|
|
|
|
only:
|
2018-04-07 07:47:08 +00:00
|
|
|
- master
|
2018-08-03 00:10:11 +00:00
|
|
|
- /^v\d+\.\d+\.\d+.*$/
|
2016-03-07 23:13:49 +00:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
email:
|
|
|
|
on_success: never
|