---
language: python
python: "2.7"
dist: trusty
sudo: True
group: beta
env:
    global:
        - VBOX_MEMORY=2048
        - VBOX_HWVIRTEX=off
    matrix:
        - TOXENV=openbsd60
        - TOXENV=xenial
        - TOXENV=trusty
        - TOXENV=precise
        - &stretch TOXENV=stretch
        - &jessie TOXENV=jessie
        - TOXENV=wheezy

cache:
  - pip
  - directories:
      - $HOME/.pre-commit
      - $HOME/.vagrant.d/boxes

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 pip install tox-travis | cat

script:
  - travis_wait 45 tox

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

matrix:
    fast_finish: True
    allow_failures:
        - env: *stretch
    include:
        - env:
            TOXENV: pre-commit
          install:
              - *pip_install
          sudo: False
