Skip to content

Commit 82bde14

Browse files
committed
CI: Add Ansible lint job
1 parent e25d4d7 commit 82bde14

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/stackhpc-pull-request.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,46 @@ jobs:
5959
- name: Run Tox ${{ matrix.environment }} 🧪
6060
run: tox -e ${{ matrix.environment }}
6161

62+
lint:
63+
runs-on: ubuntu-22.04
64+
permissions: {}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
include:
69+
# NOTE(upgrade): Keep these in sync with Kayobe's supported Ansible and Python versions (see release notes).
70+
- ansible: "2.12"
71+
# ansible-lint 6+ is not supported on Python 3.8.
72+
ansible-lint: "5"
73+
python: "3.8"
74+
- ansible: "2.13"
75+
ansible-lint: "6"
76+
python: "3.10"
77+
name: Ansible ${{ matrix.ansible }} lint with Python ${{ matrix.python }}
78+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
79+
steps:
80+
- name: GitHub Checkout 🛎
81+
uses: actions/checkout@v3
82+
83+
- name: Setup Python ${{ matrix.python-version }} 🐍
84+
uses: actions/setup-python@v4
85+
with:
86+
python-version: ${{ matrix.python }}
87+
88+
- name: Install dependencies 📦
89+
run: |
90+
python -m pip install --upgrade pip
91+
pip install ansible-core==${{ matrix.ansible }}.* ansible-lint==${{ matrix.ansible-lint }}.* -r requirements.txt
92+
93+
- name: Install Ansible Galaxy collections and roles
94+
run: |
95+
ansible-galaxy collection install -r etc/kayobe/ansible/requirements.yml
96+
ansible-galaxy role install -r etc/kayobe/ansible/requirements.yml
97+
98+
- name: Linting code 🧪
99+
run: |
100+
ansible-lint -v --force-color etc/kayobe/ansible/
101+
62102
# A skipped job is treated as success when used as a required status check.
63103
# The registered required status checks refer to the name of the job in the
64104
# called reusable workflow rather than the jobs in this file. The following

0 commit comments

Comments
 (0)