Improve CI #497
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Linting" | |
on: ["push"] | |
jobs: | |
ansible-lint: | |
name: "Lint" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout repository" | |
uses: "actions/checkout@v4" | |
- name: "Check for trailing whitespaces" | |
run: "grep --exclude-dir='.git' --exclude='*.md' --exclude='*.png' --files-with-matches --recursive '[[:blank:]]$' && exit 1 || echo 'No trailing whitespaces found.'" | |
- name: "Check for files with the yml extension" | |
run: "if [[ -n $(find . -iname '*.yml') ]]; then exit 1; fi" | |
- uses: "actions/setup-python@v5" | |
with: | |
python-version: '3.12' | |
- name: "Run shellcheck" | |
run: "find . -type f -name '*.sh*' -exec shellcheck {} \\;" | |
- name: "Disable Vault Password" | |
run: "sed --in-place --expression 's/vault_password_file/# vault_password_file/' ansible.cfg" | |
- name: "Install dependencies" | |
run: | | |
pip install --no-cache-dir --upgrade --quiet poetry | |
poetry install | |
- name: "Run ansible-lint" | |
run: "poetry run ansible-lint -q" | |
- name: "Run ruff" | |
run: "poetry run ruff check" | |
- name: "Run yamllint" | |
run: "poetry run yamllint ." |