git:
  depth: 1

env:
  DOCKER_COMPOSE_VERSION: 1.19.0

sudo: required
dist: trusty

services:
  - docker

before_install:
# Install Docker
  - sudo apt-get update
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
# Install Docker Compose
  - sudo rm /usr/local/bin/docker-compose
  - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
  - chmod +x docker-compose
  - sudo mv docker-compose /usr/local/bin

install:
  - echo $TRAVIS_BUILD_DIR
  - chmod 777 $TRAVIS_BUILD_DIR/tests/_output/
  - docker-compose -f docker-compose.sample.yml -f docker-compose.testing.yml build cli
  - docker-compose -f docker-compose.sample.yml -f docker-compose.testing.yml run --rm cli azuracast_install

script:
  - docker-compose -f docker-compose.sample.yml -f docker-compose.testing.yml run --rm cli vendor/bin/codecept run --no-interaction --coverage --coverage-xml --fail-fast

after_failure:
  - cat tests/_output/*.html
