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

This commit is contained in:
Robert Kaussow 2021-06-07 22:28:23 +02:00
parent eb2d3af8da
commit c4b2077a89
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
4 changed files with 43 additions and 13 deletions

View File

@ -13,6 +13,28 @@ local PipelineLinting = {
'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: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],

View File

@ -12,6 +12,22 @@ steps:
commands:
- 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:
ref:
- refs/heads/master
@ -164,6 +180,6 @@ depends_on:
---
kind: signature
hmac: 69da8cda952e35ab78836062197c00925c7d539df2f835ce889d17502faf24f7
hmac: ae6a040e6ee68327a1dc1a10555b0f8b0997da06b7da8513009ab1846a775fed
...

View File

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

View File

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