blob: f95b053490dc2eee91cf3f8592bccf0db7fc3653 [file] [log] [blame]
Fatih Degirmenci89b4f8f2020-01-07 00:08:50 +00001[tox]
2basepython = py36
Fatih Degirmencib6682df2020-01-12 22:35:53 +00003minversion = 2.5
Fatih Degirmenci89b4f8f2020-01-07 00:08:50 +00004skipsdist = true
Fatih Degirmenci66d1e602020-01-13 12:50:03 +00005envlist = ansible-lint, shellcheck, yamllint, docs
Fatih Degirmenci89b4f8f2020-01-07 00:08:50 +00006install_command = pip install {opts} {packages}
7deps = -r{toxinidir}/test-requirements.txt
8
9[testenv:ansible-lint]
Fatih Degirmenci66d1e602020-01-13 12:50:03 +000010description = invoke ansible-lint to analyse Ansible playbooks and roles
11deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmenci89b4f8f2020-01-07 00:08:50 +000012whitelist_externals = bash
13commands =
14 bash -c "find {toxinidir}/engine -type f -regex '.*.ya?ml' ! -regex '.*heat-template.*' -print0 | \
15 xargs -t -n1 -0 ansible-lint --nocolor"
16
17[testenv:yamllint]
Fatih Degirmenci66d1e602020-01-13 12:50:03 +000018description = invoke yamllint to analyse YAML files
19deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmenci89b4f8f2020-01-07 00:08:50 +000020whitelist_externals = bash
21commands =
22 bash -c "find {toxinidir}/engine -type f -regex '.*.ya?ml' -print0 | \
23 xargs -t -n1 -0 yamllint --format standard --strict"
24
25[testenv:shellcheck]
Fatih Degirmenci66d1e602020-01-13 12:50:03 +000026description = invoke shellcheck to analyse bash shell scripts
27deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmenci89b4f8f2020-01-07 00:08:50 +000028whitelist_externals = bash
29commands =
30 bash -c "find {toxinidir}/engine -type f -name '*.sh' -print0 | \
31 xargs -t -n1 -0 shellcheck --color=never --source-path={toxinidir}/engine \
32 --external-sources --format=tty"
Fatih Degirmenci66d1e602020-01-13 12:50:03 +000033
34[testenv:docs]
35description = invoke sphinx-build to build the HTML docs
36deps = -r{toxinidir}/test-requirements.txt
37commands = sphinx-build -c "{toxinidir}/docs" -d "{toxinidir}/.docs_doctree" docs "{toxinidir}/.docs_build" --color -W -bhtml {posargs}
38 python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / ".docs_build" / "index.html"))'