Skip to content

Commit 2867416

Browse files
authored
Extract Ansible Lint into its own GH actions job (#614)
1 parent e6876f3 commit 2867416

File tree

15 files changed

+26
-37
lines changed

15 files changed

+26
-37
lines changed

.github/workflows/molecule.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ on:
1313
- cron: "0 0 1 * *"
1414
workflow_dispatch:
1515
jobs:
16+
ansible-lint:
17+
name: Ansible Lint
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Check out the codebase
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Python 3
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: 3.x
27+
28+
- name: Install Ansible Lint
29+
run: pip3 install -r .github/workflows/requirements/requirements_ansible_lint.txt
30+
31+
- name: Install Ansible collection dependencies
32+
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml
33+
34+
- name: Run Ansible Lint
35+
run: ansible-lint --force-color
36+
1637
molecule:
1738
name: Molecule
1839
runs-on: ubuntu-22.04
@@ -35,6 +56,7 @@ jobs:
3556
- upgrade
3657
- upgrade-plus
3758
- version
59+
needs: ansible-lint
3860
steps:
3961
- name: Check out the codebase
4062
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
@@ -56,7 +78,7 @@ jobs:
5678
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
5779
run: pip3 install -r .github/workflows/requirements/requirements_molecule.txt
5880

59-
- name: Install Ansible core dependencies
81+
- name: Install Ansible collection dependencies
6082
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
6183
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml
6284

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ansible-core==2.14.4
2+
ansible-lint==6.16.0

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ENHANCEMENTS:
1515

1616
CI/CD:
1717

18+
- Split Ansible Lint into its own GH actions job since Molecule no longer runs linters natively.
1819
- Replace `molecule[docker]` with `molecule` and `molecule-plugins[docker]`.
1920
- Explicitly set the `ansible-compat` version.
2021
- Add pre-releases to Release Drafter.

molecule/default/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms:
85
- name: almalinux-8
96
image: almalinux:8

molecule/distribution/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms: # The RHEL UBI 7 image fails to install some NGINX dependencies when installing NGINX from EPEL. The role works as expected when targeting a RHEL 7 VM instead.
85
- name: almalinux-8
96
image: almalinux:8

molecule/downgrade-plus/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms: # Alpine 3.17 only has one version of NGINX Plus available (at the moment) so it's impossible to test the downgrade scenario
85
- name: almalinux-8
96
image: almalinux:8

molecule/downgrade/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms:
85
- name: almalinux-8
96
image: almalinux:8

molecule/plus/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms:
85
- name: almalinux-8
96
image: almalinux:8

molecule/source/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms: # Oracle Linux 7 works in local tests but bugs out in GitHub actions for some undetermined reason
85
- name: almalinux-8
96
image: almalinux:8

molecule/stable/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms:
85
- name: almalinux-8
96
image: almalinux:8

molecule/uninstall-plus/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms: # Ubuntu bionic results in a segmentation fault error as of Ansible core 2.13
85
- name: almalinux-8
96
image: almalinux:8

molecule/uninstall/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms:
85
- name: almalinux-8
96
image: almalinux:8

molecule/upgrade-plus/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms: # Alpine 3.17 only has one version of NGINX Plus available (at the moment) so it's impossible to test the upgrade scenario
85
- name: almalinux-8
96
image: almalinux:8

molecule/upgrade/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms:
85
- name: almalinux-8
96
image: almalinux:8

molecule/version/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
driver:
33
name: docker
4-
lint: |
5-
set -e
6-
ansible-lint --force-color
74
platforms:
85
- name: almalinux-8
96
image: almalinux:8

0 commit comments

Comments
 (0)