Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use configure_ci tool to scaffold gh workflows #2094

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
profile: production

exclude_paths:
- changelogs/changelog.yaml
- tests/
- .github/
15 changes: 9 additions & 6 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
---
name: changelog and linters
name: Linters

on: [workflow_call] # allow this workflow to be called from other workflows
on: [workflow_call]

jobs:
linters:
uses: ansible-network/github_actions/.github/workflows/tox.yml@main
with:
envname: ""
labelname: lint
uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main
ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/[email protected]
8 changes: 0 additions & 8 deletions .github/workflows/sanity.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
---
name: all_green

name: CI
concurrency:
group: ${{ github.head_ref }}
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- main
- stable-*
tags:
- "*"
workflow_dispatch:

jobs:
linters:
uses: ./.github/workflows/linters.yml # use the callable linters job to run tests
changelog:
uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main
if: github.event_name == 'pull_request'
sanity:
uses: ./.github/workflows/sanity.yml # use the callable sanity job to run tests
uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main
units:
uses: ./.github/workflows/units.yml # use the callable units job to run tests
uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the unit workflow from ansible-content-actions not do what we need?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ansible-content-actions run the unit tests on the galaxy version of the collection. It uses tox-ansible which lacks the capabilities to do a source install.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about this? When I run tox-ansible locally it looks to me like it's using my local copy. The way I read the docs for the action is that it installs the collection's dependencies from galaxy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am reaching out to the devtools team regarding this issue. It wasn't functioning earlier, and I'm not sure if there have been any alterations in tox-ansible. Currently, there isn't a workflow in ansible-content-actions to execute unit tests on the source.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct. Sorry for the confusion. tox-ansible pulls dependencies from Galaxy, not the source.

all_green:
if: ${{ always() }}
needs:
- linters
- changelog
- sanity
- units
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
python -c "assert 'failure' not in
set([
'${{ needs.linters.result }}',
'${{ needs.changelog.result }}',
'${{ needs.sanity.result }}',
'${{ needs.units.result }}'
]) == {'success'}"
])"
8 changes: 0 additions & 8 deletions .github/workflows/units.yml

This file was deleted.

8 changes: 4 additions & 4 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ plugin_routing:
rds_param_group:
redirect: amazon.aws.rds_instance_param_group
deprecation:
removal_version: 10.0.0
warning_text: >-
rds_param_group has been renamed to rds_instance_param_group.
Please update your tasks.
removal_version: 10.0.0
warning_text: >-
rds_param_group has been renamed to rds_instance_param_group.
Please update your tasks.
lookup:
aws_ssm:
# Deprecation for this alias should not *start* prior to 2024-09-01
Expand Down
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.15.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ plugins/inventory/aws_ec2.py yamllint:unparsable-with-libyaml # bug in ansible-t
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
tests/integration/targets/inventory_aws_ec2/playbooks/tasks/ symlinks
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.16.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ plugins/inventory/aws_ec2.py yamllint:unparsable-with-libyaml # bug in ansible-t
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
tests/integration/targets/inventory_aws_ec2/playbooks/tasks/ symlinks
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.17.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
tests/integration/targets/inventory_aws_ec2/playbooks/tasks/ symlinks
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.18.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
tests/integration/targets/inventory_aws_ec2/playbooks/tasks/ symlinks
14 changes: 14 additions & 0 deletions tox-ansible.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[ansible]

skip =
py3.7
py3.8
2.9
2.10
2.11
2.12
2.13
2.14

[testenv:sanity-{py3.10,py3.11,py3.12}-devel]
ignore_outcome = true
Loading