---
language: python
python: ["2.7", "3.5"]
dist: trusty
sudo: True
group: beta
env:
    global:
        - VBOX_MEMORY=2048
    matrix:
        - platform: openbsd60
        - &openbsd59 platform=openbsd59
        - platform: xenial
        - platform: trusty
        - platform: precise
        - &stretch platform=stretch
        - platform: jessie
        - platform: wheezy
matrix:
    fast_finish: True
    allow_failures:
        - python: "3.5"
        - env: *openbsd59
        - env: *stretch
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
  - travis_wait 45 molecule test --platform $platform

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