forked from Smithay/wayland-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
132 lines (118 loc) · 3.76 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
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
- nightly
env:
- FEATURES="native_lib"
- FEATURES=""
matrix:
allow_failures:
- rust: nightly
include:
- rust: stable
env: BUILD_FMT=1
- rust: nightly
env: TARPAULIN=1
sudo: true
- rust: stable
env: BUILD_DOC=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
- |
if [ -n "$BUILD_FMT" ]; then
rustup component add rustfmt-preview
elif [ -n "$TARPAULIN" ]; then
which cargo-install-update || cargo install cargo-update
cargo install-update cargo-update
env RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install-update -i cargo-tarpaulin
# sanity check, tarpaulin may fail to run after a rust upgrade and then needs recompilation
cargo tarpaulin --version || env RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin --force
# 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"
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
elif [ -n "$TARPAULIN" ]; then
cargo tarpaulin --all --features "" --ignore-tests --out Xml
bash <(curl -s https://codecov.io/bash) -cF rust_impl
cargo tarpaulin --all --features "native_lib" --ignore-tests --out Xml
bash <(curl -s https://codecov.io/bash) -cF native_lib
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 "native_lib"
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