Add GitHub workflows for linting

This commit is contained in:
Jake Howard 2019-12-08 12:07:57 +00:00 committed by Jake Howard
parent ce54cf1f4c
commit 1b96d96938
5 changed files with 49 additions and 5 deletions

17
.github/workflows/ansible.yml vendored Normal file
View 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
View 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
View 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

View File

@ -6,8 +6,4 @@ PATH=env/bin:${PATH}
set -x
yamllint -sc yamllint.yml yamllint.yml ansible/
ansible-lint ansible/main.yml -p -c ansible/.ansible-lint
ansible-playbook -i ansible/hosts ansible/main.yml --syntax-check
yamllint -sc yamllint.yml yamllint.yml .github/

View File

@ -2,5 +2,6 @@ extends: default
rules:
document-start: "disable"
truthy: "disable"
line-length:
max: 150