forked from Smithay/wayland-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
145 lines (131 loc) · 3.89 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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/install
- /home/travis/.cargo
# But don't cache the cargo registry
before_cache:
- rm -rf /home/travis/.cargo/registry
dist: trusty
sudo: false
rust:
- 1.21.0
- stable
- beta
env:
- FEATURES=""
- FEATURES="client_native"
- FEATURES="server_native"
- FEATURES="client_native server_native"
matrix:
include:
- rust: stable
env: BUILD_FMT=1
- rust: stable
env: KCOV=1
sudo: true
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- binutils-dev
- libiberty-dev
- rust: stable
env: BUILD_DOC=1
- rust: stable
env: CLIPPY=1
- rust: stable
env: TARGET=x86_64-unknown-freebsd
sudo: true
services: docker
branches:
only:
- master
before_script:
- export PATH=$HOME/.cargo/bin:$PATH
- mkdir $(pwd)/socket
- export XDG_RUNTIME_DIR="$(pwd)/socket"
- cargo fetch
- |
rustup component add rustfmt-preview
if [ -n "$CLIPPY" ]; then
rustup component add clippy
elif [ -n "$BUILD_DOC" ]; then
echo "Building doc, nothing to install..."
elif [ -n "$TARGET" ]; then
which cargo-install-update || cargo install cargo-update
cargo install-update cargo-update
cargo install-update -i cross
else
# Building & running tests, we need to install the wayland lib
./travis_install_wayland.sh "1.15.0"
export LD_LIBRARY_PATH="$HOME/install/lib:$LD_LIBRARY_PATH"
fi
- |
if [ "$TRAVIS_RUST_VERSION" == "1.21.0" ]; then
# create a Cargo.lock, and then fix dependencies that cannot build on
# rust 1.21.0
cargo update
cargo update -p lazy_static --precise 1.1.0
cargo update -p tempfile --precise 2.2.0
fi
os:
- linux
script:
- |
if [ -n "$BUILD_FMT" ]; then
cargo fmt --all -- --check
rustfmt --check tests/scanner_assets/*.rs
elif [ -n "$KCOV" ]; then
./run_kcov.sh
elif [ -n "$CLIPPY" ]; then
# - renamed_and_removed and deprecared_cfg_attr are necessary because rust 1.21.0 cannot parse
# stuff like #[allow(clippy::all)] or #[rustfmt::skip]
# for_loop_over_option is triggered by code generated by quote!()
cargo clippy --all -- -D warnings \
-A renamed_and_removed_lints \
-A clippy::deprecated_cfg_attr \
-A clippy::for_loop_over_option
cargo clippy --all --features "client_native server_native" -- -D warnings \
-A renamed_and_removed_lints \
-A clippy::deprecated_cfg_attr \
-A clippy::for_loop_over_option
elif [ -n "$BUILD_DOC" ]; then
cargo doc --all --no-deps --all-features
elif [ -n "$TARGET" ]; then
cross build --all --target "$TARGET"
cross build --all --target "$TARGET" --features "client_native server_native"
else
cargo test --all --features "$FEATURES"
fi
after_success:
- |
if [ -n "$BUILD_DOC" ]; then
cp ./doc_index.html ./target/doc/index.html
cp ./rust.css ./target/doc/rust.css
fi
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: "target/doc"
on:
branch: master
rust: stable
condition: $BUILD_DOC = 1
notifications:
webhooks:
urls:
- "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGxldmFucyUzQXNhZmFyYWRlZy5uZXQvJTIxRkt4aGprSUNwakJWelZlQ2RGJTNBc2FmYXJhZGVnLm5ldA"
on_success: change
on_failure: always
on_start: never