---
notifications:
  email:
    recipients:
      - knowledgejunkie@gmail.com

    on_success: always
    on_failure: always

sudo: required

language: bash

env:
  - release: debian_9
    distro: debian
    codename: stretch
  - release: debian_10
    distro: debian
    codename: buster
  - release: debian_sid
    distro: debian
    codename: sid
  - release: ubuntu_1604_lts
    distro: ubuntu
    codename: trusty
  - release: ubuntu_1804_lts
    distro: ubuntu
    codename: bionic
  - release: ubuntu_1810
    distro: ubuntu
    codename: cosmic
  - release: centos_6
    distro: centos
    codename: 6
  - release: centos_7
    distro: centos
    codename: 7
  - release: fedora_28
    distro: fedora
    codename: 28
  - release: fedora_29
    distro: fedora
    codename: 29

branches:
  only:
    - master

services:
  - docker

before_install:
  - export TZ=Europe/London
  - date
  - env | sort
  - sudo apt-get update -qq

install:
  - sudo docker build -f .Dockerfile.${distro}-${codename} -t xmltv-build-deps/${distro}-${codename} .
  - sudo docker run -t --detach -v $TRAVIS_BUILD_DIR:/src --name xmltv xmltv-build-deps/${distro}-${codename} /bin/bash
  - sudo docker ps -a

script:
  - docker exec -it xmltv /bin/bash -c "cd /src && perl Makefile.PL --yes"
  - docker exec -it xmltv /bin/bash -c "cd /src && make"
  - docker exec -it xmltv /bin/bash -c "cd /src && make test"
