smithay/.travis.yml

115 lines
2.4 KiB
YAML

language: rust
cache: cargo
sudo: required
rust:
- stable
- beta
- nightly
os:
- linux
dist: trusty
addons:
apt:
packages:
- libssl-dev
- libudev-dev
- libgbm-dev
- libxkbcommon-dev
- libegl1-mesa-dev
before_install:
- sudo add-apt-repository -y ppa:wayland.admin/daily-builds
- sudo apt-get update -qq
- sudo apt-get install -y libwayland-dev libinput-dev
branches:
only:
- master
env:
global:
- RUST_BACKTRACE=1
matrix:
- FEATURES=""
# test individual features
- FEATURES="backend_winit"
- FEATURES="backend_drm"
- FEATURES="backend_libinput"
- FEATURES="renderer_glium"
# test default features
- FEATURES="default"
# test all features simultaneously
- FEATURES="all"
matrix:
include:
# special features for lint & fmt
- rust: nightly
env: FEATURES="cargo-fmt"
- rust: nightly
env: FEATURES="cargo-clippy"
allow_failures:
- rust: nightly
before_script:
- export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH
- |
if [ "$FEATURES" = "cargo-fmt" ]; then
cargo install rustfmt-nightly --force;
fi
- |
if [ "$FEATURES" = "cargo-clippy" ]; then
cargo install clippy --force;
fi
- mkdir $(pwd)/socket
- export XDG_RUNTIME_DIR="$(pwd)/socket"
script:
- |
case $FEATURES in
"all")
cargo test --all-features &&
cargo doc --no-deps --all-features
;;
"default")
cargo test &&
cargo doc --no-deps
;;
"cargo-fmt")
cargo fmt -- --write-mode=diff
;;
"cargo-clippy")
cargo clippy --all-features -- -D warnings
;;
*)
cargo test --lib --doc --tests --no-default-features --features "$FEATURES" &&
cargo doc --no-deps --no-default-features --features "$FEATURES"
esac
after_success:
- cp ./doc_index.html ./target/doc/index.html
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: "${TRAVIS_BUILD_DIR}/target/doc"
on:
branch: master
rust: stable
condition: "$FEATURES = all"
notifications:
webhooks:
urls:
- "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGxldmFucyUzQXNhZmFyYWRlZy5uZXQvJTIxRkt4aGprSUNwakJWelZlQ2RGJTNBc2FmYXJhZGVnLm5ldA"
on_success: change
on_failure: always
on_start: never