language: generic
services: docker
install:
  - |
    if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
      echo "$DOCKER_HUB_PASSWORD" |
        docker login --username stephanmisc --password-stdin
    fi
    curl https://raw.githubusercontent.com/stepchowfun/toast/master/install.sh -LSfs |
      VERSION=0.28.0 sh
script:
  - |
    if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
      WRITE_REMOTE_CACHE=true
    else
      WRITE_REMOTE_CACHE=false
    fi
    toast build test lint run \
      --repo stephanmisc/toast \
      --read-remote-cache true \
      --write-remote-cache "$WRITE_REMOTE_CACHE"
