From 203c7ef3828ec0121e61b56ba6a3459aa6139b35 Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 23 Oct 2023 16:49:04 +0200 Subject: [PATCH] Linting actions improved --- .github/workflows/ansible-linting-check.yml | 19 +++++++---------- .github/workflows/galaxy.yml | 20 ++++++++++-------- .github/workflows/j2lint-check.yml | 22 ++++++++++++++++++++ .github/workflows/yamllint-check.yml | 22 ++++++++++++++++++++ .github/workflows/yamllint.yaml | 23 --------------------- 5 files changed, 62 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/j2lint-check.yml create mode 100644 .github/workflows/yamllint-check.yml delete mode 100644 .github/workflows/yamllint.yaml diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index 5ed3e8a..1a76d38 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -2,26 +2,21 @@ name: Ansible Lint check # yamllint disable-line rule:truthy -on: - push: - branches: '*' - pull_request: - branches: '*' +on: [push, pull_request] jobs: build: - + name: Ansible Lint runs-on: ubuntu-latest steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 + - name: Checkout git repo + uses: actions/checkout@v4 with: - lfs: true submodules: true fetch-depth: 0 - - name: 'Lint Ansible Playbook' - uses: ansible/ansible-lint-action@v6 + - name: Run ansible-lint + uses: ansible-actions/ansible-lint-action@v1.0.2 with: - path: "." + target: "./" diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml index adcecbd..f8beb99 100644 --- a/.github/workflows/galaxy.yml +++ b/.github/workflows/galaxy.yml @@ -1,22 +1,24 @@ --- -name: Galaxy release +name: Galaxy-NG Roles Import # yamllint disable-line rule:truthy on: - push: - branches: ['main'] release: types: ['created'] jobs: build: + name: Galaxy Role Importer runs-on: ubuntu-latest - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - name: 'release on galaxy' - uses: robertdebock/galaxy-action@1.2.0 + steps: + - name: 'Checkout git repo' + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: 'Release on galaxy' + uses: ansible-actions/ansible-galaxy-action@v1.0.1 with: galaxy_api_key: ${{ secrets.galaxy_api_key }} - git_branch: 'main' diff --git a/.github/workflows/j2lint-check.yml b/.github/workflows/j2lint-check.yml new file mode 100644 index 0000000..5037de5 --- /dev/null +++ b/.github/workflows/j2lint-check.yml @@ -0,0 +1,22 @@ +--- +name: Jinja2 Linting check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + name: Jinja2 Linting + runs-on: ubuntu-latest + + steps: + - name: 'checkout git repo' + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Run j2lint + uses: ansible-actions/j2lint-action@v0.0.1 + with: + target: "./" diff --git a/.github/workflows/yamllint-check.yml b/.github/workflows/yamllint-check.yml new file mode 100644 index 0000000..5e62f57 --- /dev/null +++ b/.github/workflows/yamllint-check.yml @@ -0,0 +1,22 @@ +--- +name: Yamllint check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + name: Yamllint + runs-on: ubuntu-latest + + steps: + - name: Checkout git repo + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Run yamllint + uses: ansible-actions/yamllint-action@v0.0.1 + with: + target: "./" diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml deleted file mode 100644 index d744e9c..0000000 --- a/.github/workflows/yamllint.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: 'Yamllint GitHub Actions' - -# yamllint disable-line rule:truthy -on: - push: - branches: '*' - pull_request: - branches: '*' - -jobs: - yamllint: - name: 'Yamllint' - runs-on: ubuntu-latest - steps: - - name: 'checkout git repo' - uses: actions/checkout@v3 - - - name: 'Yamllint' - uses: karancode/yamllint-github-action@v2.0.0 - with: - yamllint_file_or_dir: '.' - yamllint_config_filepath: './.yamllint'