
matrix:
  include:
    - os: linux
      dist: trusty
      # don't actually need sudo, but I *do* want to test with bazel sandboxing
      sudo: required
      language: java
      addons:
        apt:
          packages:
            - pkg-config
            - zip
            - g++
            - zlib1g-dev
            - unzip
      before_script:
        - wget "https://github.com/bazelbuild/bazel/releases/download/0.3.2/bazel-0.3.2-installer-linux-x86_64.sh"
        - chmod +x "bazel-0.3.2-installer-linux-x86_64.sh"
        - ./bazel-0.3.2-installer-linux-x86_64.sh --user
    - os: osx
      osx_image: xcode7.3
      before_script:
        - wget "https://github.com/bazelbuild/bazel/releases/download/0.3.2/bazel-0.3.2-installer-darwin-x86_64.sh"
        - chmod +x "bazel-0.3.2-installer-darwin-x86_64.sh"
        - ./bazel-0.3.2-installer-darwin-x86_64.sh --user

cache:
  directories:
    - $HOME/.bazel/outbase

script:
  - bazel --batch --output_base=${HOME}/.bazel/outbase test //...

language: java

env:
  - BAZEL_VERSION=0.3.2
  - BAZEL_VERSION=0.4.0

os:
  - linux
  - osx

matrix:
  allow_failures:
    - os: osx
      env: BAZEL_VERSION=0.4.0

# Only affects os=linux
dist: trusty

# Only affects os=osx
osx_image: xcode7.3

# Necessary to test with sandboxing (we don't need root, just need a real VM)
sudo: required

addons:
  apt:
    # Only affects os=linux
    packages:
      - pkg-config
      - zip
      - g++
      - zlib1g-dev
      - unzip

before_script:
  - case "$TRAVIS_OS_NAME" in
      linux) BAZEL_OS=linux  ;;
      osx)   BAZEL_OS=darwin ;;
      *)     exit 1          ;;
    esac;
    wget -O bazel-installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh"
  - chmod +x bazel-installer.sh
  - ./bazel-installer.sh --user

cache:
  directories:
    - $HOME/.bazel/outbase

script:
  - bazel --batch --output_base="${HOME}/.bazel/outbase" test //...

Test with bazel 0.3.2 and 0.4.0
Test with bazel 0.3.2 and 0.4.0
