ci: add python file checks to ci
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2021-06-07 22:28:21 +02:00
parent e89099569b
commit 1dfc03f142
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 41 additions and 7 deletions

View File

@ -13,6 +13,28 @@ local PipelineLinting = {
'ansible-later', 'ansible-later',
], ],
}, },
{
name: 'python-format',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -qq yapf',
'yapf -dr ./',
],
},
{
name: 'python-flake8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -qq flake8',
'flake8',
],
},
], ],
trigger: { trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],

View File

@ -12,6 +12,22 @@ steps:
commands: commands:
- ansible-later - ansible-later
- name: python-format
image: python:3.9
commands:
- pip install -qq yapf
- yapf -dr ./
environment:
PY_COLORS: 1
- name: python-flake8
image: python:3.9
commands:
- pip install -qq flake8
- flake8
environment:
PY_COLORS: 1
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
@ -131,6 +147,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: a70ebc0bd4bd49c042aa9be8924b58979bed25d11ef30a4f8ed8b490d1d2cd8e hmac: c670912db94387fbe21dc69941988520c57e75659a06477425c77327b344a0f0
... ...

View File

@ -2,13 +2,9 @@ import os
import testinfra.utils.ansible_runner import testinfra.utils.ansible_runner
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE'] os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts('all') ).get_hosts("all")
def test_mosquitto_is_installed(host): def test_mosquitto_is_installed(host):