ci: Comply with Ansible partner certification checking [citest_skip]#189
Merged
Conversation
https://github.com/ansible-collections/partner-certification-checker/blob/main/README.md Unfortunately we cannot use the checkers provided by their team because they assume the git repo is in collection format - you cannot convert to collection format first then point the checkers at that collection. Instead, implement our own checkers that do the same (and more) - check with multiple versions of ansible-lint and ansible-test to ensure we cover: * all supported versions of EL * Automation Hub gating * the latest versions of Ansible, including the latest milestone version This requires the latest version of tox-lsr Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Reviewer's GuideUpdate GitHub Actions CI workflows to align with Ansible partner certification requirements by running ansible-lint and ansible-test through tox-lsr across multiple Ansible/Python versions, and by upgrading tox-lsr to 3.18.0 throughout the repository. Sequence diagram for ansible-lint job using tox-lsr across multiple versionssequenceDiagram
actor Developer
participant GitHub as GitHubActions
participant Job as ansible-lint_job
participant Matrix as MatrixRunner
participant SetupPy as setup-python_action
participant tox as tox_lsr
participant AnsCore as ansible_core
participant AnsLint as ansible_lint
Developer->>GitHub: Push or open PR (without [citest_skip])
GitHub->>Job: Trigger ansible-lint workflow
Job->>Matrix: Initialize matrix {ansible_lint, ansible, python}
loop For each matrix entry
Matrix->>SetupPy: Configure Python version
SetupPy-->>Matrix: Python runtime ready
Matrix->>tox: Install tox-lsr 3.18.0 and invoke tox
tox->>tox: Run env collection (convert role to collection)
tox->>AnsCore: Install ansible-core==matrix.ansible
tox->>AnsLint: Install ansible-lint==matrix.ansible_lint
tox->>AnsLint: Run ansible-lint on collection
AnsLint-->>tox: Lint results (pass/fail)
tox-->>Matrix: Env result
end
Matrix-->>Job: Aggregated matrix results
Job-->>GitHub: Job status
GitHub-->>Developer: Report CI status on PR
Flow diagram for updated ansible-lint GitHub Actions job with matrix and tox-lsrflowchart TD
A["Workflow trigger (push or pull_request without [citest_skip])"] --> B["Start ansible-lint job"]
B --> C["Define matrix versions: ansible_lint, ansible, python"]
C --> D["Update pip and git"]
D --> E["Install tox and tox-lsr 3.18.0 via pip"]
E --> F["Set up Python using actions/setup-python@v6 with matrix python"]
F --> G["Run tox with environments: collection, ansible-lint-collection"]
G --> H["tox-lsr creates collection test env"]
H --> I["tox-lsr runs ansible-lint-collection env"]
I --> J["Install ansible-core==matrix.ansible"]
J --> K["Install ansible-lint==matrix.ansible_lint"]
K --> L["Execute ansible-lint on converted collection"]
L --> M{"All matrix versions pass?"}
M -->|Yes| N["Mark ansible-lint job successful"]
M -->|No| O["Mark ansible-lint job failed"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/ansible-collections/partner-certification-checker/blob/main/README.md
Unfortunately we cannot use the checkers provided by their team because they assume
the git repo is in collection format - you cannot convert to collection format first
then point the checkers at that collection. Instead, implement our own checkers that
do the same (and more) - check with multiple versions of ansible-lint and ansible-test
to ensure we cover:
This requires the latest version of tox-lsr
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Align CI Ansible linting and testing workflows with Ansible partner certification requirements by running matrixed ansible-lint and ansible-test jobs across multiple supported Ansible and Python versions using updated tox-lsr tooling.
CI:
Tests: