sudo: false
language: rust

matrix:
  include:
    - os: linux
      rust: stable
      compiler: gcc
    - os: linux
      rust: nightly
      compiler: gcc
    - os: osx
      rust: stable
      osx_image: xcode9
      compiler: clang

branches:
  except:
    - staging.tmp

before_install:
  # Do not run bors builds against the nightly compiler.
  # We want to find out about nightly bugs, so they're done in master, but we don't block on them.
  - if [[ $TRAVIS_RUST_VERSION == "nightly" && $TRAVIS_BRANCH == "staging" ]]; then exit; fi
  - if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew update && brew install sdl2 && brew upgrade cmake && export CXX=clang++ && export MACOSX_DEPLOYMENT_TARGET=10.9; fi

addons:
  apt:
    sources:
      # install a newer cmake since at this time Travis only has version 2.8.7
      - george-edison55-precise-backports
      - llvm-toolchain-precise-3.8
      - ubuntu-toolchain-r-test
      #- ppa:xorg-edgers/ppa # for libosmesa6-dev
    packages:
      - xdotool
      - cmake
      - cmake-data
      - libxxf86vm-dev
      - libxinerama-dev
      - libxinerama1
      - libxcursor-dev
      - libxcursor1
      - libglfw-dev
      - libosmesa6-dev
      - libxi-dev
      - libxrandr-dev
      - g++-5
      - gcc

script:
  - if [[ $TRAVIS_RUST_VERSION == "nightly" && $TRAVIS_BRANCH == "staging" ]]; then exit; fi
  - export PATH=$PATH:$HOME/deps/bin
  - make