---
language: python
python: ["2.7", "3.4"]
dist: trusty
sudo: True
group: beta
services: [docker]
env:
    - platform: openbsd60
      driver: vagrant
    - &openbsd59 platform=openbsd59 driver=vagrant
    - platform: xenial
      driver: vagrant
    - platform: trusty
      driver: vagrant
    - &precise platform=precise driver=vagrant
    - &jessie platform=jessie driver=vagrant
    - &wheezy platform=wheezy driver=vagrant
    - driver: docker
      platform: all
matrix:
    fast_finish: True
    allow_failures:
        - python: "3.4"
        - env: *openbsd59
        - env: *precise
        - env: *jessie
        - env: *wheezy
cache:
  - pip
  - directories:
      - $HOME/.pre-commit

install:
  - sudo apt-get update
  - sudo apt-get install -y linux-headers-$(uname -r) virtualbox
  - wget https://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb
  - sudo dpkg -i vagrant_1.9.1_x86_64.deb
  - pip install -r tests/requirements.txt | cat
  - ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles
  - molecule dependency

script:
  - pre-commit run --all-files
  - molecule test --driver $driver --platform $platform

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/
  email: false
