From 47b9e8dc4cd3bf20c590a65aeca23ae6fd8dd7b0 Mon Sep 17 00:00:00 2001 From: AnsibleGuy Date: Wed, 28 Jun 2023 20:56:17 +0200 Subject: [PATCH] added lints as github-workflow --- .github/workflows/autolint.yml | 46 ++++++++++++++++++++++++++++++++++ requirements_lint.txt | 5 ++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/autolint.yml create mode 100644 requirements_lint.txt diff --git a/.github/workflows/autolint.yml b/.github/workflows/autolint.yml new file mode 100644 index 0000000..95545bf --- /dev/null +++ b/.github/workflows/autolint.yml @@ -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 diff --git a/requirements_lint.txt b/requirements_lint.txt new file mode 100644 index 0000000..c48fa2e --- /dev/null +++ b/requirements_lint.txt @@ -0,0 +1,5 @@ +# pip requirements +yamllint +pylint +ansible-core +ansible-lint