Merge pull request #7 from w-miller/travis

Add Travis CI config
This commit is contained in:
Mark Goddard 2018-09-07 10:50:05 +01:00 committed by GitHub
commit ae3a22cd50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 2 deletions

32
.travis.yml Normal file
View File

@ -0,0 +1,32 @@
---
language: python
python: "2.7"
# Run jobs in VMs - sudo is required by ansible tests.
sudo: required
# Install ansible
addons:
apt:
packages:
- gcc
- python-apt
- python-virtualenv
- realpath
# Create a build matrix for the different test jobs.
env:
matrix:
# Run python style checks.
- TOX_ENV=pep8
# Run Ansible linting.
- TOX_ENV=alint
install:
# Install tox in a virtualenv to ensure we have an up to date version.
- pip install -U pip
- pip install tox
script:
# Run the tox environment.
- tox -e ${TOX_ENV}

View File

@ -23,12 +23,12 @@ deps =
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
basepython = python3
basepython = python2.7
commands =
flake8 {posargs}
[testenv:alint]
basepython = python3
basepython = python2.7
# ansible-lint doesn't support custom modules, so add ours to the Ansible path.
setenv = ANSIBLE_LIBRARY = {toxinidir}/ansible/action_plugins/
# Exclude roles downloaded from Galaxy (in the form 'author.role') from