Fatih Degirmenci | 89b4f8f | 2020-01-07 00:08:50 +0000 | [diff] [blame] | 1 | [tox] |
| 2 | basepython = py36 |
Fatih Degirmenci | b6682df | 2020-01-12 22:35:53 +0000 | [diff] [blame] | 3 | minversion = 2.5 |
Fatih Degirmenci | 89b4f8f | 2020-01-07 00:08:50 +0000 | [diff] [blame] | 4 | skipsdist = true |
Fatih Degirmenci | 66d1e60 | 2020-01-13 12:50:03 +0000 | [diff] [blame] | 5 | envlist = ansible-lint, shellcheck, yamllint, docs |
Fatih Degirmenci | 89b4f8f | 2020-01-07 00:08:50 +0000 | [diff] [blame] | 6 | install_command = pip install {opts} {packages} |
| 7 | deps = -r{toxinidir}/test-requirements.txt |
| 8 | |
| 9 | [testenv:ansible-lint] |
Fatih Degirmenci | 66d1e60 | 2020-01-13 12:50:03 +0000 | [diff] [blame] | 10 | description = invoke ansible-lint to analyse Ansible playbooks and roles |
| 11 | deps = -r{toxinidir}/test-requirements.txt |
Fatih Degirmenci | 89b4f8f | 2020-01-07 00:08:50 +0000 | [diff] [blame] | 12 | whitelist_externals = bash |
| 13 | commands = |
| 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 Degirmenci | 66d1e60 | 2020-01-13 12:50:03 +0000 | [diff] [blame] | 18 | description = invoke yamllint to analyse YAML files |
| 19 | deps = -r{toxinidir}/test-requirements.txt |
Fatih Degirmenci | 89b4f8f | 2020-01-07 00:08:50 +0000 | [diff] [blame] | 20 | whitelist_externals = bash |
| 21 | commands = |
| 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 Degirmenci | 66d1e60 | 2020-01-13 12:50:03 +0000 | [diff] [blame] | 26 | description = invoke shellcheck to analyse bash shell scripts |
| 27 | deps = -r{toxinidir}/test-requirements.txt |
Fatih Degirmenci | 89b4f8f | 2020-01-07 00:08:50 +0000 | [diff] [blame] | 28 | whitelist_externals = bash |
| 29 | commands = |
| 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 Degirmenci | 66d1e60 | 2020-01-13 12:50:03 +0000 | [diff] [blame] | 33 | |
| 34 | [testenv:docs] |
| 35 | description = invoke sphinx-build to build the HTML docs |
| 36 | deps = -r{toxinidir}/test-requirements.txt |
| 37 | commands = 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"))' |