-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.travis.yml
70 lines (62 loc) · 1.33 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
language: rust
# only cache cargo subcommand binaries and wayland libs .so
# the build artifacts take a lot of space and are slower to
# cache than to actually rebuild anyway...
# We need to cache the whole .cargo directory to keep the
# .crates.toml file.
cache:
directories:
- /home/travis/.cargo
# But don't cache the cargo registry
before_cache:
- rm -rf /home/travis/.cargo/registry
dist: trusty
sudo: required
rust:
- stable
- beta
- nightly
matrix:
allow_failures:
- rust: nightly
include:
- rust: stable
env: BUILD_FMT=1
- rust: stable
env: BUILD_DOC=1
branches:
only:
- master
before_script:
- cargo fetch
- |
if [ -n "$BUILD_FMT" ]; then
rustup component add rustfmt-preview
elif [ -n "$BUILD_DOC" ]; then
echo "Building doc, nothing to install..."
fi
os:
- linux
script:
- |
if [ -n "$BUILD_FMT" ]; then
cargo fmt -- --check
elif [ -n "$BUILD_DOC" ]; then
cargo doc --no-deps --all-features
else
cargo check
fi
after_success:
- |
if [ -n "$BUILD_DOC" ]; then
cp ./doc_index.html ./target/doc/index.html
fi
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: "target/doc"
on:
branch: master
rust: stable
condition: $BUILD_DOC = 1