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
5f4cda172f
commit
fda5a92f30
@ -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: 86cb256dd171c3a6aa44f2c07bb8c37a68f86f07537f0532ef59f21861a3af5b
|
hmac: 7f5e268d5ff07ae5eebc96a7dc1281aab9dc4e005a3943e871fe4bc44bedc3fe
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -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_dnsmasq_is_installed(host):
|
def test_dnsmasq_is_installed(host):
|
||||||
|
Loading…
Reference in New Issue
Block a user