Add a linting workflow
This commit is contained in:
9
.ansible-lint
Normal file
9
.ansible-lint
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
profile: production
|
||||||
|
strict: true
|
||||||
|
|
||||||
|
# Enable checking of loop variable prefixes in roles
|
||||||
|
loop_var_prefix: "^(__|{role}_)"
|
||||||
|
|
||||||
|
exclude_paths:
|
||||||
|
- .github/
|
||||||
41
.github/workflows/linters.yml
vendored
Normal file
41
.github/workflows/linters.yml
vendored
Normal file
@@ -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}
|
||||||
Reference in New Issue
Block a user