-
Notifications
You must be signed in to change notification settings - Fork 20
/
tox.ini
55 lines (50 loc) · 2.03 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
[tox]
minversion = 2.3.1
envlist = ansible-lint
skipsdist = True
[testenv]
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
deps = -r{toxinidir}/test-requirements.txt
commands =
# Cleanup cache files to avoid failures when running tox on developer env.
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
whitelist_externals =
bash
find
git
rm
[testenv:venv]
commands = {posargs}
[testenv:ansible-lint]
# For the full ansible-lint default rules, refer to the following link:
# https://ansible-lint.readthedocs.io/en/latest/default_rules.html
#
# Disabled rules:
# - 'unnamed-task' We don't mind having tasks that are unnamed
# - 'no-changed-when' We don't mind that there will be tasks that will always return ok
# - 'no-handler' We don't mind that we're running tasks based on a previous task that returned changed
# - 'package-latest' We don't mind installing latest packages
usedevelop = False
skip_install = True
deps = -rtest-requirements.txt
# both ansible-lint and yamllint use a single tox env to improve build speed and
# reduce disk space. Both are sharing lots of common requirements and most
# time is spend installing dependencies.
setenv =
VIRTUALENV_NO_DOWNLOAD=1
# ANSIBLE_CONFIG avoid the undesired case where tox->ansible would load user own ~/ansible.cfg (if any)
ANSIBLE_CONFIG={toxinidir}/ansible.cfg
ANSIBLE_COLLECTION_PATH=/tmp/.collections
# Regex for file paths in git ls-tree might not work all the times, we should consider changing this
# ansible-lint will install ansible collections on its own
commands =
# Check playbooks linting
bash -c "git ls-tree --full-tree --name-only -r HEAD playbooks | grep -E '\.ya?ml$' | xargs ansible-lint -vvvv -p --force-color"
# Check molecule linting
bash -c "git ls-tree --full-tree --name-only -r HEAD ./**/**/**/molecule | grep -E 'molecule' | grep -E '\.ya?ml$' | grep -vE 'molecule\.ya?ml' | xargs ansible-lint -p --force-color"
[testenv:docs]
commands = python setup.py build_sphinx