forked from rust-lang/mdBook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
82 lines (72 loc) · 2 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
language: rust
cache:
directories:
- "$HOME/.cargo"
# - "$HOME/.cache/sccache"
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
before_install:
- |
# export RUSTC_WRAPPER=sccache;
cd "$(mktemp -d)";
case "$TRAVIS_OS_NAME" in
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;
;;
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;
;;
* ) unset RUSTC_WRAPPER;;
esac;
cd "$TRAVIS_BUILD_DIR";
script:
- cargo test --all
- cargo test --all --no-default-features
- |
if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then
rustup component add rustfmt && \
cargo fmt --all -- --check;
fi
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"
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