From 68a36b274bda36756645c637181bc87e2a642642 Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Thu, 20 Apr 2023 10:54:38 -0400 Subject: [PATCH] Add github action for sanity and unit tests (#1393) SUMMARY Add github action workflow. ISSUE TYPE Feature Pull Request --- .github/workflows/tests.yml | 149 ++++++++++++++++++ .../add_github_actions_unitandsanity.yml | 3 + 2 files changed, 152 insertions(+) create mode 100644 .github/workflows/tests.yml create mode 100644 changelogs/fragments/add_github_actions_unitandsanity.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000000..fb083a5f246 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,149 @@ +--- +name: Test collection + +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + +on: # yamllint disable-line rule:truthy + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + linters: + uses: abikouo/github_actions/.github/workflows/tox-linters.yml@tox_linters + changelog: + uses: ansible-network/github_actions/.github/workflows/changelog.yml@main + sanity: + uses: ansible-network/github_actions/.github/workflows/sanity.yml@main + with: + matrix_include: "[]" + matrix_exclude: >- + [ + { + "ansible-version": "stable-2.9" + }, + { + "ansible-version": "stable-2.12", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.12", + "python-version": "3.11" + }, + { + "ansible-version": "stable-2.13", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.13", + "python-version": "3.11" + }, + { + "ansible-version": "stable-2.14", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.14", + "python-version": "3.8" + }, + { + "ansible-version": "stable-2.15", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.15", + "python-version": "3.8" + }, + { + "ansible-version": "milestone", + "python-version": "3.7" + }, + { + "ansible-version": "milestone", + "python-version": "3.8" + }, + { + "ansible-version": "devel", + "python-version": "3.7" + }, + { + "ansible-version": "devel", + "python-version": "3.8" + } + ] + unit-source: + uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main + with: + matrix_exclude: >- + [ + { + "python-version": "3.11" + }, + { + "ansible-version": "stable-2.12", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.13", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.12", + "python-version": "3.8" + }, + { + "ansible-version": "stable-2.13", + "python-version": "3.8" + }, + { + "ansible-version": "stable-2.14", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.14", + "python-version": "3.8" + }, + { + "ansible-version": "stable-2.15", + "python-version": "3.7" + }, + { + "ansible-version": "stable-2.15", + "python-version": "3.8" + }, + { + "ansible-version": "milestone", + "python-version": "3.7" + }, + { + "ansible-version": "milestone", + "python-version": "3.8" + }, + { + "ansible-version": "devel", + "python-version": "3.7" + }, + { + "ansible-version": "devel", + "python-version": "3.8" + } + ] + collection_pre_install: '' + all_green: + if: ${{ always() }} + needs: + - changelog + - linters + - sanity + - unit-source + runs-on: ubuntu-latest + steps: + - run: >- + python -c "assert set([ + '${{ needs.changelog.result }}', + '${{ needs.sanity.result }}', + '${{ needs.linters.result }}', + '${{ needs.unit-source.result }}' + ]) == {'success'}" diff --git a/changelogs/fragments/add_github_actions_unitandsanity.yml b/changelogs/fragments/add_github_actions_unitandsanity.yml new file mode 100644 index 00000000000..53c7b7a5a5d --- /dev/null +++ b/changelogs/fragments/add_github_actions_unitandsanity.yml @@ -0,0 +1,3 @@ +--- +minor_changes: +- Add github actions to run unit and sanity tests.(https://github.com/ansible-collections/amazon.aws/pull/1393).