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