diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..43cae14 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,9 @@ +--- +profile: production +strict: true + +# Enable checking of loop variable prefixes in roles +loop_var_prefix: "^(__|{role}_)" + +exclude_paths: + - .github/ diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000..7c3eaad --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,41 @@ +--- +name: linters + +on: + pull_request: + branches: [ "master" ] + push: + branches: [ "master" ] + +jobs: + + ansible-lint: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v5 + + + - uses: mamba-org/setup-micromamba@7f29b8b80078b1b601dfa018b0f7425c587c63bb + with: + micromamba-version: '2.4.0-0' + environment-file: ci/conda.yml + init-shell: bash + post-cleanup: 'all' + + # - name: "Install role dependencies" + # run: ansible-galaxy install -r requirements.yml + # shell: micromamba-shell {0} + + - name: Check workflow files themselves with ActionLint + run: actionlint + shell: micromamba-shell {0} + + - name: Check environment files with YAMLLint + run: yamllint ci/*.yml + shell: micromamba-shell {0} + + - name: Run ansible-lint + run: ansible-lint -c .ansible-lint + shell: micromamba-shell {0}