From b4ea609b6f72ae9c33450b38bb9b8c17a33bb674 Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Wed, 15 May 2024 13:56:30 -0400 Subject: [PATCH 1/6] Use configure_ci tool to scaffold gh workflows --- .github/workflows/linters.yml | 20 +++++++++---- .github/workflows/sanity.yml | 8 ------ .../{all_green_check.yml => tests.yml} | 28 +++++++++---------- .github/workflows/units.yml | 8 ------ tox-ansible.ini | 14 ++++++++++ 5 files changed, 42 insertions(+), 36 deletions(-) delete mode 100644 .github/workflows/sanity.yml rename .github/workflows/{all_green_check.yml => tests.yml} (51%) delete mode 100644 .github/workflows/units.yml create mode 100644 tox-ansible.ini diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 0bbf1025dc3..7ca301fd71b 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,11 +1,19 @@ --- -name: changelog and linters +name: Linters -on: [workflow_call] # allow this workflow to be called from other workflows +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true +on: + push: + pull_request: 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/ansible-lint@v6.22.1 diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml deleted file mode 100644 index d3d4e312089..00000000000 --- a/.github/workflows/sanity.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: sanity tests - -on: [workflow_call] # allow this workflow to be called from other workflows - -jobs: - sanity: - uses: ansible-network/github_actions/.github/workflows/sanity.yml@main diff --git a/.github/workflows/all_green_check.yml b/.github/workflows/tests.yml similarity index 51% rename from .github/workflows/all_green_check.yml rename to .github/workflows/tests.yml index 9f2a8347d61..8f628a7f692 100644 --- a/.github/workflows/all_green_check.yml +++ b/.github/workflows/tests.yml @@ -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 + 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'}" + ])" diff --git a/.github/workflows/units.yml b/.github/workflows/units.yml deleted file mode 100644 index 4d8de6bb101..00000000000 --- a/.github/workflows/units.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: unit tests - -on: [workflow_call] # allow this workflow to be called from other workflows - -jobs: - unit-source: - uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main diff --git a/tox-ansible.ini b/tox-ansible.ini new file mode 100644 index 00000000000..f4ee11769e6 --- /dev/null +++ b/tox-ansible.ini @@ -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 From d08fe251ca808176d618b90294ec5b17dbb9fe0d Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Wed, 15 May 2024 14:03:28 -0400 Subject: [PATCH 2/6] Fix linters.yml --- .github/workflows/linters.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 7ca301fd71b..7491715fe8e 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -4,9 +4,7 @@ name: Linters concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true -on: - push: - pull_request: +on: [workflow_call] jobs: linters: From 6cd914129c712843ba8b180d9a9e039e5112d00e Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Wed, 15 May 2024 14:13:44 -0400 Subject: [PATCH 3/6] Fix linters.yml --- .github/workflows/linters.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 7491715fe8e..d5f097f4f29 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,9 +1,6 @@ --- name: Linters -concurrency: - group: ${{ github.head_ref || github.run_id }} - cancel-in-progress: true on: [workflow_call] jobs: From 6ab16b373268ee4c2ad3c4efe16c6ff18329e0cf Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Tue, 28 May 2024 11:32:53 -0400 Subject: [PATCH 4/6] ignore symlinks failure --- .ansible-lint | 6 ++++++ tests/sanity/ignore-2.15.txt | 1 + tests/sanity/ignore-2.16.txt | 1 + tests/sanity/ignore-2.17.txt | 1 + tests/sanity/ignore-2.18.txt | 1 + 5 files changed, 10 insertions(+) create mode 100644 .ansible-lint diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 00000000000..8bedf15d29d --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,6 @@ +--- +profile: production + +exclude_paths: + - changelogs/changelog.yaml + - tests/integration diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 78c6a8f6792..3a8b527736f 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -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 diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 78c6a8f6792..3a8b527736f 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -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 diff --git a/tests/sanity/ignore-2.17.txt b/tests/sanity/ignore-2.17.txt index ff6c70c3d42..d38577ccbfd 100644 --- a/tests/sanity/ignore-2.17.txt +++ b/tests/sanity/ignore-2.17.txt @@ -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 diff --git a/tests/sanity/ignore-2.18.txt b/tests/sanity/ignore-2.18.txt index ff6c70c3d42..d38577ccbfd 100644 --- a/tests/sanity/ignore-2.18.txt +++ b/tests/sanity/ignore-2.18.txt @@ -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 From 5d4f2f291f1656fc64268d76a071d2708119cec4 Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Tue, 28 May 2024 11:40:31 -0400 Subject: [PATCH 5/6] ignore tests for ansible-lint --- .ansible-lint | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ansible-lint b/.ansible-lint index 8bedf15d29d..a3d90f6d7ee 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -3,4 +3,5 @@ profile: production exclude_paths: - changelogs/changelog.yaml - - tests/integration + - tests/ + - .github/ From c2e742959cb9ce759cdee5cb0ec31d4cec28f937 Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Tue, 28 May 2024 11:45:08 -0400 Subject: [PATCH 6/6] Fix yamllint failure --- meta/runtime.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/runtime.yml b/meta/runtime.yml index 94614615f1e..f2b31fdc845 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -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