forked from linux-system-roles/sudo
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (58 loc) · 2 KB
/
ansible-lint.yml
File metadata and controls
63 lines (58 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
name: Ansible Lint
on: # yamllint disable-line rule:truthy
pull_request:
merge_group:
branches:
- main
types:
- checks_requested
push:
branches:
- main
workflow_dispatch:
env:
LSR_ROLE2COLL_NAMESPACE: fedora
LSR_ROLE2COLL_NAME: linux_system_roles
permissions:
contents: read
jobs:
ansible_lint:
if: |
!((github.event_name == 'pull_request' && contains(github.event.pull_request.title, '[citest_skip]')) ||
(github.event_name == 'push' && contains(github.event.head_commit.message, '[citest_skip]')))
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# There should be one version which is the one used by the Automation Hub gating, and
# one for the latest version.
# https://github.com/ansible-collections/partner-certification-checker/blob/main/.github/workflows/certification-reusable.yml#L108
versions:
- { ansible_lint: "24.*", ansible: "2.16.*", python: "3.12" }
- { ansible_lint: "26.*", ansible: "2.20.*", python: "3.13" }
steps:
- name: Update pip, git
run: |
set -euxo pipefail
sudo apt update
sudo apt install -y git
- name: Checkout repo
uses: actions/checkout@v6
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.18.1"
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.versions.python }}
- name: Convert role to collection format
run: tox -e collection
- name: Run ansible-lint
run: |
set -euxo pipefail
LSR_ANSIBLE_LINT_DEP="ansible-lint==${{ matrix.versions.ansible_lint }}" \
LSR_ANSIBLE_LINT_ANSIBLE_DEP="ansible-core==${{ matrix.versions.ansible }}" \
tox -x testenv:ansible-lint-collection.basepython="python${{ matrix.versions.python }}" \
-e ansible-lint-collection