-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
106 lines (92 loc) · 4.53 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
language: rust
cache: cargo
env:
global:
- RUST_BACKTRACE=1
matrix:
include:
- rust: 1.31.1
env: DESCRIPTION="minimum supported Rust"
script:
- cargo test --verbose --all --lib
- cargo test --verbose --all --tests
- cargo test --verbose --all --lib --features "quickcheck"
- cargo test --verbose --all --tests --features "quickcheck"
- rust: stable
env: DESCRIPTION="stable Rust, clippy"
install:
- rustup component add clippy-preview || echo "Could not install clippy"
script:
- cargo test --verbose --all --lib
- cargo test --verbose --all --tests
- which cargo-clippy && cargo clippy --verbose --all
- cargo test --verbose --all --lib --features "quickcheck"
- cargo test --verbose --all --tests --features "quickcheck"
- which cargo-clippy && cargo clippy --verbose --all --features "quickcheck"
- rust: beta
env: DESCRIPTION="beta Rust, clippy"
install:
- rustup component add clippy-preview || echo "Could not install clippy"
script:
- cargo test --verbose --all --lib
- cargo test --verbose --all --tests
- which cargo-clippy && cargo clippy --verbose --all
- cargo test --verbose --all --lib --features "quickcheck"
- cargo test --verbose --all --tests --features "quickcheck"
- which cargo-clippy && cargo clippy --verbose --all --features "quickcheck"
- rust: nightly
env: DESCRIPTION="nightly Rust, clippy"
install:
# `which cargo-clippy` always succeeds, resort to setting a boolean
- if rustup component add clippy-preview; then HAS_CLIPPY=true; else HAS_CLIPPY=false; echo "Could not install clippy"; fi
script:
- cargo test --verbose --all --lib --features "nightly test-nightly-regressions"
- cargo test --verbose --all --tests --features "nightly test-nightly-regressions"
- if "${HAS_CLIPPY}"; then cargo clippy --verbose --all --features "nightly test-nightly-regressions"; fi
- cargo test --verbose --all --lib --features "nightly quickcheck test-nightly-regressions"
- cargo test --verbose --all --tests --features "nightly quickcheck test-nightly-regressions"
- if "${HAS_CLIPPY}"; then cargo clippy --verbose --all --features "nightly quickcheck test-nightly-regressions"; fi
- cargo test --verbose --manifest-path bench-suite/Cargo.toml --all --benches
- cargo update -Z minimal-versions
- cargo build --verbose --manifest-path serde_mtproto_derive/Cargo.toml --lib
- if "${HAS_CLIPPY}"; then cargo clippy --verbose --manifest-path serde_mtproto_derive/Cargo.toml; fi
# Host documentation on <https://hcpl.github.com/serde_mtproto>
- rust: nightly
env: DESCRIPTION="build and upload docs"
install:
- cargo install cargo-update || echo "cargo-update already installed"
- cargo install cargo-travis || echo "cargo-travis already installed"
- cargo install-update cargo-travis
script:
- cargo doc --manifest-path Cargo.toml --features "quickcheck"
- cargo doc --manifest-path serde_mtproto_derive/Cargo.toml
- git clone --depth=1 --branch gh-pages "https://github.com/${TRAVIS_REPO_SLUG}" target/gh-pages
- |
if [ -e "target/gh-pages/${TRAVIS_BRANCH}/index.html" ]; then
rm -f target/doc/index.html
else
echo '<!DOCTYPE html>' > target/doc/index.html
echo '<meta http-equiv="refresh" content="0; url=serde_mtproto/">' >> target/doc/index.html
echo '<a href="serde_mtproto/">Redirect</a>' >> target/doc/index.html
fi
- rm -rf target/gh-pages
after_success:
- cargo doc-upload --message $'Automatic Travis documentation build\n\n'"${TRAVIS_COMMIT_MESSAGE}"
after_success:
- |
# Run benchmarks against master and PR branch
# Adapted from <https://beachape.com/blog/2016/11/02/rust-performance-testing-on-travis-ci/>
if [ "${TRAVIS_PULL_REQUEST}" = true ] && [ "${TRAVIS_RUST_VERSION}" = nightly ]; then
cd "${TRAVIS_BUILD_DIR}"/.. &&
git clone "${REMOTE_URL}" "${TRAVIS_REPO_SLUG}-bench" &&
cd "${TRAVIS_REPO_SLUG}-bench" &&
# Bench master
git checkout master &&
cargo bench > before &&
# Bench PR'ing branch
git checkout "${TRAVIS_COMMIT}" &&
cargo bench > after &&
# Compare results
cargo install --force cargo-benchcmp &&
cargo benchcmp --include-missing before after
fi