git:
  depth: false
cache:
  - ccache
  - directories:
    - $HOME/roms/
language: cpp # Needed for ccache
env:
  - PYVER=3.5
  - PYVER=3.6
os:
  - linux
  - osx
services:
  - docker
osx_image: xcode8

before_script:
  - mkdir -p $HOME/roms
script:
  - >
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
    docker run
    --env PYVER="$PYVER"
    --env TRAVIS_OS_NAME="$TRAVIS_OS_NAME"
    --env TRAVIS_TAG="$TRAVIS_TAG"
    --env TRAVIS_BRANCH="$TRAVIS_BRANCH"
    --env TRAVIS_PULL_REQUEST="$TRAVIS_PULL_REQUEST"
    --env GOOGLE_APPLICATION_CREDENTIALS_DATA="$GOOGLE_APPLICATION_CREDENTIALS_DATA"
    --volume /home/travis/build/openai/retro:/root/code/retro
    --volume /home/travis/.ccache:/root/.ccache
    --workdir /root/code/retro
    quay.io/openai/travis-build
    python travis.py;
    fi
  - |
    if [ "$TRAVIS_OS_NAME" == "osx" ]; then
    curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
    bash miniconda.sh -b
    export PATH=/usr/local/opt/ccache/libexec:$HOME/miniconda3/bin:$PATH
    hash -r
    conda create -y -q -n venv python=$PYVER pip
    source activate venv
    pip install wheel google-cloud pytest
    python travis.py
    fi
