ci: add python file checks to ci
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
212feececf
commit
bc8676c911
@ -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/**'],
|
||||||
|
18
.drone.yml
18
.drone.yml
@ -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: 6cb8536bea1c868dbc5ab68a687fe2e4c0de2a862d53df7b3987f94fac770095
|
hmac: 25d487adaee22d6ef67dfaf638dd174067450411292dcf29244a405d6aa01e38
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -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_motd_files(host):
|
def test_motd_files(host):
|
||||||
|
Loading…
Reference in New Issue
Block a user