Skip to content

Commit 99a0fed

Browse files
committed
CI: Add Ansible lint job
1 parent 97f8975 commit 99a0fed

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
@@ -61,6 +61,46 @@ jobs:
6161
- name: Run Tox ${{ matrix.environment }} 🧪
6262
run: tox -e ${{ matrix.environment }}
6363

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

0 commit comments

Comments
 (0)