Add GitHub workflows for linting
This commit is contained in:
parent
ce54cf1f4c
commit
1b96d96938
5 changed files with 49 additions and 5 deletions
17
.github/workflows/ansible.yml
vendored
Normal file
17
.github/workflows/ansible.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
name: Ansible
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up Python 3.7
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r dev-requirements.txt
|
||||||
|
- name: Run linters
|
||||||
|
run: ./scripts/ansible-lint.sh
|
17
.github/workflows/lint.yml
vendored
Normal file
17
.github/workflows/lint.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
name: Lint
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up Python 3.7
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r dev-requirements.txt
|
||||||
|
- name: Run linters
|
||||||
|
run: ./scripts/lint.sh
|
13
scripts/ansible-lint.sh
Executable file
13
scripts/ansible-lint.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PATH=env/bin:${PATH}
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
yamllint -sc yamllint.yml ansible/
|
||||||
|
|
||||||
|
ansible-lint ansible/main.yml -p -c ansible/.ansible-lint
|
||||||
|
|
||||||
|
ansible-playbook -i ansible/hosts ansible/main.yml --syntax-check
|
|
@ -6,8 +6,4 @@ PATH=env/bin:${PATH}
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
yamllint -sc yamllint.yml yamllint.yml ansible/
|
yamllint -sc yamllint.yml yamllint.yml .github/
|
||||||
|
|
||||||
ansible-lint ansible/main.yml -p -c ansible/.ansible-lint
|
|
||||||
|
|
||||||
ansible-playbook -i ansible/hosts ansible/main.yml --syntax-check
|
|
||||||
|
|
|
@ -2,5 +2,6 @@ extends: default
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
document-start: "disable"
|
document-start: "disable"
|
||||||
|
truthy: "disable"
|
||||||
line-length:
|
line-length:
|
||||||
max: 150
|
max: 150
|
||||||
|
|
Loading…
Reference in a new issue