added lints as github-workflow

This commit is contained in:
AnsibleGuy 2023-06-28 20:56:17 +02:00
parent 6b6a361489
commit 47b9e8dc4c
No known key found for this signature in database
GPG Key ID: 52984C069F5AD3CD
2 changed files with 51 additions and 0 deletions

46
.github/workflows/autolint.yml vendored Normal file
View File

@ -0,0 +1,46 @@
---
name: AutoLint
on:
push:
branches: [main, stable]
pull_request:
branches: [main, stable]
jobs:
build:
strategy:
matrix:
python-version: [3.10]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
shell: bash
- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r requirements_lint.txt
shell: bash
- name: Running PyLint
run: pylint --recursive=y .
shell: bash
- name: Running YamlLint
run: yamllint .
shell: bash
- name: Running AnsibleLint
run: ansible-lint -c .ansible-lint.yml
shell: bash

5
requirements_lint.txt Normal file
View File

@ -0,0 +1,5 @@
# pip requirements
yamllint
pylint
ansible-core
ansible-lint