diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml new file mode 100644 index 0000000..29a0f46 --- /dev/null +++ b/.github/workflows/ansible.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..8c9879d --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/scripts/ansible-lint.sh b/scripts/ansible-lint.sh new file mode 100755 index 0000000..7b33cc5 --- /dev/null +++ b/scripts/ansible-lint.sh @@ -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 diff --git a/scripts/lint.sh b/scripts/lint.sh index 7808c43..1e2b808 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -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/ diff --git a/yamllint.yml b/yamllint.yml index aa6adf7..2e6cda4 100644 --- a/yamllint.yml +++ b/yamllint.yml @@ -2,5 +2,6 @@ extends: default rules: document-start: "disable" + truthy: "disable" line-length: max: 150