Skip to content

Commit

Permalink
ci: Use supported ansible-lint action; run ansible-lint against the c…
Browse files Browse the repository at this point in the history
…ollection

The old ansible-community ansible-lint is deprecated.  There is a
new ansible-lint github action.

The latest Ansible repo gating tests run ansible-lint against
the collection format instead of against individual roles.
We have to convert the role to collection format before running
ansible-test.

Role developers can run this locally using
`tox -e collection,ansible-lint-collection`
See linux-system-roles/tox-lsr#125

Add `---` doc start to .markdownlint.yaml

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Dec 13, 2023
1 parent 15171e6 commit 263a314
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ jobs:
# ansible-lint action requires a .git directory???
# https://github.com/ansible/ansible-lint/blob/main/action.yml#L45
mkdir -p "$coll_dir/.git"
# need .ansible-lint at the collection root directory
for file in "$coll_dir"/roles/*/.ansible-lint; do
if [ -f "$file" ]; then
cp "$file" "$coll_dir"
break
fi
done
# doesn't like mock_roles
sed -e '/^mock_roles:/d' -e '/- linux-system-roles[.]/d' \
-i "$coll_dir/.ansible-lint"
Expand Down

0 comments on commit 263a314

Please sign in to comment.