amethyst 0.10.0

Data-oriented game engine written in Rust
sudo: required

language: rust

addons:
  apt:
    packages:
    - libasound2-dev
    - libsdl2-dev

os:
- linux
- osx
- windows

rust:
- stable
- beta
- nightly

matrix:
  fast_finish: true
  allow_failures:
  - os: windows
  - rust: nightly

branches:
  only:
  - staging
  - trying

before_install:
- |
  if [ ${TRAVIS_OS_NAME} == "windows" ]
  then
    wget --no-check-certificate https://www.libsdl.org/release/SDL2-devel-2.0.8-VC.zip
    7z x SDL2-devel-2.0.8-VC.zip
    cp SDL2-2.0.8/lib/x64/*.lib ${HOME}/.rustup/toolchains/${TRAVIS_RUST_VERSION}-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/lib
    cp SDL2-2.0.8/lib/x64/*.dll .
    rm SDL2-devel-2.0.8-VC.zip
  elif [ ${TRAVIS_OS_NAME} == "osx" ]
  then
    brew update && brew install sdl2
  else
    export MDBOOK_RELEASE="v0.2.1/mdbook-v0.2.1-x86_64-unknown-linux-gnu.tar.gz"
    curl -L -o mdbook.tar.gz https://github.com/rust-lang-nursery/mdBook/releases/download/${MDBOOK_RELEASE}
    tar -xvf mdbook.tar.gz -C ./
    rm mdbook.tar.gz
  fi

before_script:
- export PATH=$PATH:/home/travis/.cargo/bin
- |
  if [ ${TRAVIS_RUST_VERSION} == "stable" ]
  then
    export RUSTFLAGS="-D warnings"
  fi

# Generate documentation, compile the engine, run tests.
script:
- |
  echo "Build and test"
  cargo test --all || exit 1
- |
  if [ ${TRAVIS_RUST_VERSION} == "stable" ] && [ ${TRAVIS_OS_NAME} == "linux" ]
  then
    echo "Test book"
    ./mdbook test book -L target/debug/deps
  fi
- |
  if [ ${TRAVIS_RUST_VERSION} == "stable" ]
  then
    echo "Check common features"
    cargo check --all --features sdl_controller,profiler
  fi