From ec63acffdc62f02d23d41a85e06931fa97cc7e74 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 15 Jan 2020 22:33:09 +0100 Subject: [PATCH] test travis --- .travis.yml | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tox.ini | 66 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 .travis.yml create mode 100644 tox.ini diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..56a5375 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,80 @@ +--- +version: "~> 1.0" + +os: linux + +language: python + +python: + - '3.8' + - '3.7' + - '3.6' + +services: docker + +cache: + pip: true + directories: + - ".tox" + +install: + - pip install tox-travis +env: + jobs: + - TOX_DISTRO=alpinelatest TOX_ANSIBLE=latest + - TOX_DISTRO=alpine310 TOX_ANSIBLE=latest + - TOX_DISTRO=alpine39 TOX_ANSIBLE=latest + - TOX_DISTRO=centoslatest TOX_ANSIBLE=latest + - TOX_DISTRO=centos8 TOX_ANSIBLE=latest + - TOX_DISTRO=centos7 TOX_ANSIBLE=latest + - TOX_DISTRO=clearlinuxlatest TOX_ANSIBLE=latest + - TOX_DISTRO=debianlatest TOX_ANSIBLE=latest + - TOX_DISTRO=debianstable TOX_ANSIBLE=latest + - TOX_DISTRO=debian10 TOX_ANSIBLE=latest + - TOX_DISTRO=debian9 TOX_ANSIBLE=latest + - TOX_DISTRO=debian8 TOX_ANSIBLE=latest + - TOX_DISTRO=fedoralatest TOX_ANSIBLE=latest + - TOX_DISTRO=fedora31 TOX_ANSIBLE=latest + - TOX_DISTRO=fedora30 TOX_ANSIBLE=latest + - TOX_DISTRO=fedora29 TOX_ANSIBLE=latest + - TOX_DISTRO=fedora28 TOX_ANSIBLE=latest + - TOX_DISTRO=opensuselatest TOX_ANSIBLE=latest + - TOX_DISTRO=opensuse15 TOX_ANSIBLE=latest + - TOX_DISTRO=ubuntulatest TOX_ANSIBLE=latest + - TOX_DISTRO=ubuntu2004 TOX_ANSIBLE=latest + - TOX_DISTRO=ubuntu1904 TOX_ANSIBLE=latest + - TOX_DISTRO=ubuntu1804 TOX_ANSIBLE=latest + - TOX_DISTRO=ubuntu1604 TOX_ANSIBLE=latest + - TOX_DISTRO=alpinelatest TOX_ANSIBLE={29,28} + - TOX_DISTRO=alpine310 TOX_ANSIBLE={29,28} + - TOX_DISTRO=alpine39 TOX_ANSIBLE={29,28} + - TOX_DISTRO=centoslatest TOX_ANSIBLE={29,28} + - TOX_DISTRO=centos8 TOX_ANSIBLE={29,28} + - TOX_DISTRO=centos7 TOX_ANSIBLE={29,28} + - TOX_DISTRO=clearlinuxlatest TOX_ANSIBLE={29,28} + - TOX_DISTRO=debianlatest TOX_ANSIBLE={29,28} + - TOX_DISTRO=debianstable TOX_ANSIBLE={29,28} + - TOX_DISTRO=debian10 TOX_ANSIBLE={29,28} + - TOX_DISTRO=debian9 TOX_ANSIBLE={29,28} + - TOX_DISTRO=debian8 TOX_ANSIBLE={29,28} + - TOX_DISTRO=fedoralatest TOX_ANSIBLE={29,28} + - TOX_DISTRO=fedora31 TOX_ANSIBLE={29,28} + - TOX_DISTRO=fedora30 TOX_ANSIBLE={29,28} + - TOX_DISTRO=fedora29 TOX_ANSIBLE={29,28} + - TOX_DISTRO=fedora28 TOX_ANSIBLE={29,28} + - TOX_DISTRO=opensuselatest TOX_ANSIBLE={29,28} + - TOX_DISTRO=opensuse15 TOX_ANSIBLE={29,28} + - TOX_DISTRO=ubuntulatest TOX_ANSIBLE={29,28} + - TOX_DISTRO=ubuntu2004 TOX_ANSIBLE={29,28} + - TOX_DISTRO=ubuntu1904 TOX_ANSIBLE={29,28} + - TOX_DISTRO=ubuntu1804 TOX_ANSIBLE={29,28} + - TOX_DISTRO=ubuntu1604 TOX_ANSIBLE={29,28} +script: + - tox -e $(echo py${TRAVIS_PYTHON_VERSION} | tr -d .)-ansible${TOX_ANSIBLE}-${TOX_DISTRO} + - | + rm -r .tox/py*/log/* + find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ + diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..d17394b --- /dev/null +++ b/tox.ini @@ -0,0 +1,66 @@ +[tox] +minversion = 3.7 +envlist = py{3}-ansible{latest,29,28}-{ alpinelatest,alpine310,alpine39,alpine38, centoslatest,centos8,centos7, debianlatest,debian10,debian9,debian8, fedoralatest,fedora30,fedora29,fedora28, ubuntulatest,ubuntu2004,ubuntu1904,ubuntu1804,ubuntu1604 } + +# only test currently supported ansible versions +# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status + +skipsdist = true + +[base] +passenv = * +deps = + -rrequirements.txt + ansible25: ansible==2.5 + ansible26: ansible==2.6 + ansible27: ansible==2.7 + ansible28: ansible==2.8 + ansible29: ansible==2.9 + ansiblelatest: ansible +commands = + molecule test +setenv = + TOX_ENVNAME={envname} + MOLECULE_EPHEMERAL_DIRECTORY=/tmp/{envname} + +[testenv] +passenv = + {[base]passenv} +deps = + {[base]deps} +commands = + {[base]commands} +setenv = + alpinelatest: MOLECULE_DISTRO="alpine:latest" + alpine310: MOLECULE_DISTRO="alpine:3.10" + alpine39: MOLECULE_DISTRO="alpine:3.9" + alpine38: MOLECULE_DISTRO="alpine:3.8" + + centoslatest: MOLECULE_DISTRO="centos:latest" + centos8: MOLECULE_DISTRO="centos:8" + centos7: MOLECULE_DISTRO="centos:7" + + clearlinuxlatest: MOLECULE_DISTRO="clearlinux:latest" + + debianlatest: MOLECULE_DISTRO="debian:latest" + debianstable: MOLECULE_DISTRO="debian:stable" + debian10: MOLECULE_DISTRO="debian:10" + debian9: MOLECULE_DISTRO="debian:9" + debian8: MOLECULE_DISTRO="debian:8" + + fedoralatest: MOLECULE_DISTRO="fedora:latest" + fedora31: MOLECULE_DISTRO="fedora:31" + fedora30: MOLECULE_DISTRO="fedora:30" + fedora29: MOLECULE_DISTRO="fedora:29" + fedora28: MOLECULE_DISTRO="fedora:28" + + opensuselatest: MOLECULE_DISTRO="opensuse/leap:latest" + opensuse15: MOLECULE_DISTRO="opensuse/leap:15" + + ubuntulatest: MOLECULE_DISTRO="ubuntu:latest" + ubuntu2004: MOLECULE_DISTRO="ubuntu:20.04" + ubuntu1904: MOLECULE_DISTRO="ubuntu:19.04" + ubuntu1804: MOLECULE_DISTRO="ubuntu:18.04" + ubuntu1604: MOLECULE_DISTRO="ubuntu:16.04" + + {[base]setenv} \ No newline at end of file