From db02969168069b718d0a1ee2eb0bd12e5e30a793 Mon Sep 17 00:00:00 2001 From: June Date: Sun, 1 Dec 2024 04:16:42 +0100 Subject: [PATCH] add CI running ansible-lint --- .forgejo/workflows/lint.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .forgejo/workflows/lint.yaml diff --git a/.forgejo/workflows/lint.yaml b/.forgejo/workflows/lint.yaml new file mode 100644 index 0000000..47b5a1d --- /dev/null +++ b/.forgejo/workflows/lint.yaml @@ -0,0 +1,32 @@ +# Links & Resources: +# https://github.com/ansible/ansible-lint?tab=readme-ov-file#using-ansible-lint-as-a-github-action +# https://github.com/ansible/ansible-lint/blob/main/action.yml +on: + pull_request: + push: + +jobs: + ansible-lint: + name: Ansible Lint + runs-on: docker + steps: + - uses: actions/checkout@v4 + - name: Install pip + run: | + apt update + apt install -y pip + - name: Install python jmespath + run: | + pip install jmespath + env: + PIP_BREAK_SYSTEM_PACKAGES: 1 + # Don't let it setup python as the then called setup-python action doesn't + # work in our environmnet. + # Rather manually setup python (pip) before instead. + - name: Run ansible-lint + uses: https://github.com/ansible/ansible-lint@main + with: + setup_python: "false" + requirements_file: "requirements.yml" + env: + PIP_BREAK_SYSTEM_PACKAGES: 1