diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml new file mode 100644 index 0000000000..004d0ee947 --- /dev/null +++ b/.forgejo/workflows/ci.yaml @@ -0,0 +1,33 @@ +name: Linter +on: [push, pull-request] + +jobs: + lint: + runs-on: infra-1 + steps: + - name: Install testing tools + run: | + sudo dnf install -y yamllint ansible-lint + + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v42 + + - name: Run yamllint + if: steps.changed-files.outputs.any_changed == 'true' + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + yamllint "$file" + done + + - name: Run ansible-lint + if: steps.changed-files.outputs.any_changed == 'true' + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + ansible-lint "$file" + done diff --git a/.gitignore b/.gitignore index 3a14f17b97..3a380a4d3d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ # emacs projectile .projectile + +# ansible-lint directory +.ansible/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 4e63c40921..0000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -repos: - -# - repo: https://github.com/pre-commit/pre-commit-hooks -# rev: v3.2.0 -# hooks: -# - id: trailing-whitespace -# - id: end-of-file-fixer -# - id: check-yaml -# - id: check-added-large-files - -- repo: https://github.com/adrienverge/yamllint - rev: v1.35.1 - hooks: - - id: yamllint - -# - repo: https://github.com/ansible/ansible-lint -# rev: v24.12.1 -# hooks: -# - id: ansible-lint diff --git a/.yamllint.yaml b/.yamllint.yaml index b5251e97f3..45753282c7 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -23,4 +23,7 @@ rules: # level: warning truthy: allowed-values: ['true', 'false', 'yes', 'no'] + +ignore: + - '*/templates/*' ... diff --git a/.zuul.yaml b/.zuul.yaml deleted file mode 100644 index 7a02e6f580..0000000000 --- a/.zuul.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- project: - check: - jobs: - - fi-ansible-lint-diff - - fi-yamllint-diff