-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use latest version of ansible-lint 2.16; fix lint issues
Use the latest supported ansible-lint github action which requires conversion to collection. Add .ansible-lint to the converted collection. Add dependabot checking for latest versions of github actions Use `mode: "0NNN"` instead of `mode: 0NNN`. ansible-test requires supported version `>= 2.13.0` even though the code still supports earlier versions of ansible. Signed-off-by: Rich Megginson <[email protected]>
- Loading branch information
Showing
15 changed files
with
68 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
commit-message: | ||
prefix: ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
--- | ||
name: Ansible Lint | ||
on: # yamllint disable-line rule:truthy | ||
merge_group: | ||
branches: | ||
- main | ||
types: | ||
- checks_requested | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
env: | ||
LSR_ROLE2COLL_NAMESPACE: performancecopilot | ||
LSR_ROLE2COLL_NAME: metrics | ||
TOX_WORK_DIR: .tox | ||
permissions: | ||
contents: read | ||
jobs: | ||
ansible_lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Fix up role meta/main.yml namespace and name | ||
- name: Convert role to collection format | ||
run: | | ||
set -euxo pipefail | ||
mm=meta/main.yml | ||
if [ -f "$mm" ]; then | ||
if ! grep -q '^ *namespace:' "$mm"; then | ||
sed "/galaxy_info:/a\ namespace: performancecopilot" -i "$mm" | ||
fi | ||
if ! grep -q '^ *role_name:' "$mm"; then | ||
sed "/galaxy_info:/a\ role_name: metrics" -i "$mm" | ||
fi | ||
fi | ||
coll_dir="$TOX_WORK_DIR/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}" | ||
bash scripts/lsrcollection.sh | ||
# ansible-lint action requires a .git directory??? | ||
# https://github.com/ansible/ansible-lint/blob/main/action.yml#L45 | ||
mkdir -p "$coll_dir/.git" | ||
- name: Run ansible-lint | ||
uses: ansible-community/ansible-lint-action@v6 | ||
uses: ansible/ansible-lint@v6 | ||
with: | ||
working_directory: ${{ env.TOX_WORK_DIR }}/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
requires_ansible: ">=2.11.0" | ||
requires_ansible: ">=2.13.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters