mdBook/.travis.yml

83 lines
2.0 KiB
YAML
Raw Normal View History

2017-09-03 22:31:15 +08:00
language: rust
2019-05-07 05:41:44 +08:00
cache:
directories:
- "$HOME/.cargo"
2019-08-04 00:19:04 +08:00
# - "$HOME/.cache/sccache"
2019-05-07 05:41:44 +08:00
env:
global:
- CRATE_NAME=mdbook
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
- rust: 1.34.0 # Minimum required Rust version
env: TARGET=x86_64-unknown-linux-gnu
- rust: stable
os: osx
env: TARGET=x86_64-apple-darwin
2019-05-07 05:41:44 +08:00
before_install:
- |
2019-08-04 00:19:04 +08:00
# export RUSTC_WRAPPER=sccache;
cd "$(mktemp -d)";
case "$TRAVIS_OS_NAME" in
2019-05-07 05:41:44 +08:00
linux )
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-07 05:41:44 +08:00
;;
osx )
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-07 05:41:44 +08:00
;;
* ) unset RUSTC_WRAPPER;;
esac;
cd "$TRAVIS_BUILD_DIR";
2017-09-03 22:44:49 +08:00
script:
- cargo test --all
- cargo test --all --no-default-features
- |
if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then
2019-06-29 00:14:26 +08:00
rustup component add rustfmt && \
cargo fmt --all -- --check;
fi
2017-09-03 22:44:49 +08:00
before_deploy:
- cargo run -- build book-example
- sh ci/before_deploy.sh
deploy:
- provider: releases
api_key: "$GITHUB_TOKEN"
file_glob: true
file: "$CRATE_NAME-$TRAVIS_TAG-$TARGET.*"
on:
condition: "$TRAVIS_RUST_VERSION = stable"
tags: true
skip_cleanup: true
- provider: pages
local_dir: book-example/book
skip_cleanup: true
github_token: "$GITHUB_TOKEN"
2019-06-21 13:17:03 +08:00
keep_history: false
on:
condition: $TRAVIS_OS_NAME = "linux" && $TRAVIS_RUST_VERSION = "stable"
tags: true
branches:
only:
- master
- /^v\d+\.\d+\.\d+.*$/
notifications:
email:
on_success: never