From f3e0c0917f8be35acd1a07b55f6ac66af5a45ebe Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 19:40:26 +0530 Subject: [PATCH 01/19] DNM: content-actions refactor Signed-off-by: NilashishC --- .github/workflows/integretion.yml | 7 ------ .github/workflows/tests.yml | 38 +++---------------------------- 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/.github/workflows/integretion.yml b/.github/workflows/integretion.yml index f41b19614..238a83709 100644 --- a/.github/workflows/integretion.yml +++ b/.github/workflows/integretion.yml @@ -1,12 +1,5 @@ name: Integration on: - pull_request_target: - branches: [main] - types: - - labeled - - opened - - reopened - - synchronize workflow_dispatch: jobs: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5e8d914d4..ad8098a61 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,3 +1,4 @@ + --- name: "CI" @@ -13,40 +14,7 @@ on: # yamllint disable-line rule:truthy - cron: '0 0 * * *' jobs: - changelog: - uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main - if: github.event_name == 'pull_request' - build-import: - uses: ansible/ansible-content-actions/.github/workflows/build_import.yaml@main - ansible-lint: - uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main - sanity: - uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main - unit-galaxy: - uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main - unit-source: - uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main - with: - collection_pre_install: >- - git+https://github.com/ansible-collections/ansible.utils.git - git+https://github.com/ansible-collections/ansible.netcommon.git - all_green: - if: ${{ always() }} - needs: - - changelog - - build-import - - sanity - - unit-galaxy - - unit-source - - ansible-lint + tox_matrix: runs-on: ubuntu-latest steps: - - run: >- - python -c "assert 'failure' not in - set([ - '${{ needs.changelog.result }}', - '${{ needs.sanity.result }}', - '${{ needs.unit-galaxy.result }}' - '${{ needs.ansible-lint.result }}' - '${{ needs.unit-source.result }}' - ])" + - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix/action.yaml@actions_refactor From 51b9e6752c2c6099fbc474bf6195f1ed571cff57 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 19:47:24 +0530 Subject: [PATCH 02/19] fix typo Signed-off-by: NilashishC --- .github/workflows/check_label.yml | 11 -- .github/workflows/codecoverage.yml | 16 --- .github/workflows/draft_release.yml | 18 --- .github/workflows/integretion.yml | 24 ---- .github/workflows/integretion_utils.yml | 176 ------------------------ .github/workflows/release.yml | 14 -- .github/workflows/tests.yml | 2 +- 7 files changed, 1 insertion(+), 260 deletions(-) delete mode 100644 .github/workflows/check_label.yml delete mode 100644 .github/workflows/codecoverage.yml delete mode 100644 .github/workflows/draft_release.yml delete mode 100644 .github/workflows/integretion.yml delete mode 100644 .github/workflows/integretion_utils.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/check_label.yml b/.github/workflows/check_label.yml deleted file mode 100644 index b120bfa32..000000000 --- a/.github/workflows/check_label.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: "Check label" -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -on: # yamllint disable-line rule:truthy - pull_request_target: - types: [opened, labeled, unlabeled, synchronize] -jobs: - check_label: - uses: ansible/ansible-content-actions/.github/workflows/check_label.yaml@main diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml deleted file mode 100644 index 034589bc1..000000000 --- a/.github/workflows/codecoverage.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: "Code coverage" - -on: # yamllint disable-line rule:truthy - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - codecoverage: - uses: ansible-network/github_actions/.github/workflows/coverage_network_devices.yml@main - with: - collection_pre_install: >- - git+https://github.com/ansible-collections/ansible.utils.git - git+https://github.com/ansible-collections/ansible.netcommon.git diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml deleted file mode 100644 index 618f8a379..000000000 --- a/.github/workflows/draft_release.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: "Draft release" -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -on: # yamllint disable-line rule:truthy - workflow_dispatch: -env: - NAMESPACE: ${{ github.repository_owner }} - COLLECTION_NAME: nxos - ANSIBLE_COLLECTIONS_PATHS: ./ -jobs: - update_release_draft: - uses: ansible/ansible-content-actions/.github/workflows/draft_release.yaml@main - with: - repo: ${{ github.event.pull_request.head.repo.full_name }} - secrets: - BOT_PAT: ${{ secrets.BOT_PAT }} diff --git a/.github/workflows/integretion.yml b/.github/workflows/integretion.yml deleted file mode 100644 index 238a83709..000000000 --- a/.github/workflows/integretion.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Integration -on: - workflow_dispatch: - -jobs: - safe-to-test: - if: >- - github.event.label.name == 'safe to test' || - github.event.action != 'labeled' - uses: ansible-network/github_actions/.github/workflows/safe-to-test.yml@main - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - integration: - uses: ./.github/workflows/integretion_utils.yml - needs: - - safe-to-test - with: - network_os: cisco.nxos.nxos - pytest_addopts: "--color=yes -n 2 --log-level WARNING -vvv --role-excludes=snmp_server" - secrets: - CML_SSH_PASSWORD: ${{ secrets.CML_SSH_PASSWORD }} - VIRL_HOST: ${{ secrets.VIRL_HOST }} - VIRL_PASSWORD: ${{ secrets.VIRL_PASSWORD }} diff --git a/.github/workflows/integretion_utils.yml b/.github/workflows/integretion_utils.yml deleted file mode 100644 index 87b0299e2..000000000 --- a/.github/workflows/integretion_utils.yml +++ /dev/null @@ -1,176 +0,0 @@ -name: Integration tests -on: - workflow_call: - inputs: - collection_pre_install: - required: false - type: string - default: "" - cml_lab: - default: tests/integration/labs/single.yaml - required: false - type: string - integration_test_path: - default: tests/integration/targets - required: false - type: string - network_os: - required: true - type: string - pytest_addopts: - default: "" - required: false - type: string - - secrets: - CML_SSH_PASSWORD: - required: true - VIRL_PASSWORD: - required: true - VIRL_HOST: - required: true - -jobs: - integration: - env: - PY_COLORS: "1" - source_directory: "./source" - dependency_directory: "./dependency" - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - ansible-version: - - stable-2.14 - # - stable-2.15 - # - milestone - # - devel - python-version: - - "3.11" - dependency-source: - - github - - - name: "py${{ matrix.python-version }} / ${{ matrix.ansible-version }} / ${{ matrix.dependency-source }}" - steps: - - name: Checkout the collection repository - uses: ansible-network/github_actions/.github/actions/checkout_dependency@main - with: - path: ${{ env.source_directory }} - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: "0" - - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install wheel now for faster builds - run: python${{ matrix.python-version }} -m pip install wheel --upgrade - - - name: Install ansible-core (${{ matrix.ansible-version }}) - run: | - python${{ matrix.python-version }} -m pip install \ - https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz \ - --disable-pip-version-check - - - name: Print the ansible version - run: ansible --version - - - name: Pre install collections dependencies first so the collection install does not - run: ansible-galaxy collection install --pre ${{ inputs.collection_pre_install }} -p /home/runner/collections - if: inputs.collection_pre_install != '' - - - name: Read collection metadata from galaxy.yml - id: identify - uses: ansible-network/github_actions/.github/actions/identify_collection@main - with: - source_path: ${{ env.source_directory }} - - - name: Checkout ${{ steps.identify.outputs.dependency }} - if: steps.identify.outputs.dependency != '' && matrix.dependency-source == 'github' - uses: ansible-network/github_actions/.github/actions/checkout_dependency@main - with: - repository: ansible-collections/${{ steps.identify.outputs.dependency }} - path: ${{ env.dependency_directory }} - fetch-depth: "0" - - - name: Read collection metadata from ${{ steps.identify.outputs.dependency }} - if: steps.identify.outputs.dependency != '' && matrix.dependency-source == 'github' - id: identify-dependency - uses: ansible-network/github_actions/.github/actions/identify_collection@main - with: - source_path: ${{ env.dependency_directory }} - - - name: Build and install ${{ steps.identify.outputs.dependency }} - if: steps.identify.outputs.dependency != '' && matrix.dependency-source == 'github' - uses: ansible-network/github_actions/.github/actions/build_install_collection@main - with: - python-version: ${{ matrix.python-version }} - install_python_dependencies: true - source_path: ${{ env.dependency_directory }} - collection_path: ${{ steps.identify-dependency.outputs.collection_path }} - tar_file: ${{ steps.identify-dependency.outputs.tar_file }} - - - name: Build and install the collection - uses: NilashishC/github_actions/.github/actions/build_install_collection@main - with: - python_version: ${{ matrix.python-version }} - install_python_dependencies: true - source_path: ${{ env.source_directory }} - collection_path: ${{ steps.identify.outputs.collection_path }} - tar_file: ${{ steps.identify.outputs.tar_file }} - ansible_version: ${{ matrix.ansible-version }} - - - name: Print the python dependencies - run: python${{ matrix.python-version }} -m pip list - - - name: Install the integration test dependency - run: python${{ matrix.python-version }} -m pip install git+https://github.com/ashwini-mhatre/pytest-ansible-network-integration.git - - - name: echo secrets - run: echo "${{ secrets.cml_ssh_password }}" - - - name: Clear current lab id if any - run: 'python3.11 -m pip install virl2_client==2.6.1 && cml clear' - continue-on-error: true - env: - CML_VERIFY_CERT: False - VIRL_HOST: ${{ secrets.virl_host }} - VIRL_PASSWORD: ${{ secrets.virl_password }} - VIRL_USERNAME: admin - - - name: Run integration tests - run: >- - python${{ matrix.python-version }} -m pytest tests/integration - --integration-tests-path ${{ inputs.integration_test_path }} - --cml-lab ${{ inputs.cml_lab }} - ${{ inputs.pytest_addopts }} - env: - ANSIBLE_FORCE_COLOR: "1" - ANSIBLE_NETWORK_OS: ${{ inputs.network_os }} - CML_SSH_PASSWORD: ${{ secrets.CML_SSH_PASSWORD }} - CML_SSH_PORT: 1122 - CML_SSH_USER: sysadmin - VIRL_HOST: ${{ secrets.VIRL_HOST }} - VIRL_PASSWORD: ${{ secrets.VIRL_PASSWORD }} - VIRL_USERNAME: admin - working-directory: ${{ steps.identify.outputs.collection_path }} - - - name: Attempt to remove any labs in case the workflow was cancelled - if: cancelled() - run: echo ${{ env.CML_LABS }} | tr -d '\n' | xargs -d ',' -i sh -c 'cml use --id {} && cml rm --force --no-confirm' - continue-on-error: true - env: - CML_VERIFY_CERT: False - VIRL_HOST: ${{ secrets.virl_host }} - VIRL_PASSWORD: ${{ secrets.virl_password }} - VIRL_USERNAME: admin - - - name: Upload logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: logs - path: /home/runner/test_logs/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 6dbb1aa39..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: "Release collection" -on: # yamllint disable-line rule:truthy - release: - types: [published] - -jobs: - release: - uses: ansible/ansible-content-actions/.github/workflows/release.yaml@main - with: - environment: release - secrets: - ah_token: ${{ secrets.AH_TOKEN }} - ansible_galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad8098a61..b4a9ea05c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,4 +17,4 @@ jobs: tox_matrix: runs-on: ubuntu-latest steps: - - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix/action.yaml@actions_refactor + - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor From cc54f25bdcb1bccf9c4ed83f4685664ed3ce736c Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 19:56:26 +0530 Subject: [PATCH 03/19] scope Signed-off-by: NilashishC --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b4a9ea05c..e45896c4d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,3 +18,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor + with: + scope: unit \ No newline at end of file From 907788978df46f7267434c513352c90326a73f0f Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 20:08:17 +0530 Subject: [PATCH 04/19] test Signed-off-by: NilashishC --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e45896c4d..eabd8c65b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,10 +13,10 @@ on: # yamllint disable-line rule:truthy schedule: - cron: '0 0 * * *' -jobs: +jobs:` tox_matrix: runs-on: ubuntu-latest steps: - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor - with: - scope: unit \ No newline at end of file + #with: + # scope: unit \ No newline at end of file From ecbdc77e9c329c7d5f2ecc751f5d739ec681285d Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 20:09:36 +0530 Subject: [PATCH 05/19] test Signed-off-by: NilashishC --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eabd8c65b..73a78a849 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy schedule: - cron: '0 0 * * *' -jobs:` +jobs: tox_matrix: runs-on: ubuntu-latest steps: From 32525843f287b4dbdbf3f5819d9668e6d9d13261 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 20:13:19 +0530 Subject: [PATCH 06/19] test Signed-off-by: NilashishC --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 73a78a849..9421d4001 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,5 +18,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor - #with: - # scope: unit \ No newline at end of file + id: build-matrix + with: + scope: unit + - run: | + echo ${{ steps.build-matrix.outputs.envlist }} From d308158726912a8fe198b25e92a2bcf0f964a537 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 20:22:57 +0530 Subject: [PATCH 07/19] test Signed-off-by: NilashishC --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9421d4001..c38dae680 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,4 +22,4 @@ jobs: with: scope: unit - run: | - echo ${{ steps.build-matrix.outputs.envlist }} + ${{ steps.build-matrix.outputs.envlist }} From c56f3e24d03b88cbb8787c2c0a1d9755687b9160 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 20:44:26 +0530 Subject: [PATCH 08/19] update Signed-off-by: NilashishC --- .github/workflows/tests.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c38dae680..c86e335da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,12 +14,24 @@ on: # yamllint disable-line rule:truthy - cron: '0 0 * * *' jobs: - tox_matrix: + tox-matrix: runs-on: ubuntu-latest steps: - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor id: build-matrix with: scope: unit - - run: | - ${{ steps.build-matrix.outputs.envlist }} + outputs: + envlist: "${{ steps.build-matrix.outputs.envlist }}" + run-tests: + needs: tox-matrix + strategy: + fail-fast: false + matrix: + entry: "${{ fromJson(needs.tox-matrix.outputs.envlist) }}" + name: "${{ matrix.entry.name }}" + runs-on: ubuntu-latest + steps: + - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-tests@actions_refactor + with: + matrix-input: "${{ matrix.entry }}" From be35b097e932347319b5f44cb4e869595a031641 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 21:08:14 +0530 Subject: [PATCH 09/19] update Signed-off-by: NilashishC --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c86e335da..a770a2734 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,4 +34,5 @@ jobs: steps: - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-tests@actions_refactor with: - matrix-input: "${{ matrix.entry }}" + matrix-name: "${{ matrix.entry.name }}" + matrix-pthon: "${{ matrix.entry.python }}" From a7dca7031582c7b9e873a4f5daa7e500c04d1470 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 21:09:45 +0530 Subject: [PATCH 10/19] update Signed-off-by: NilashishC --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a770a2734..d745b8737 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,4 +35,4 @@ jobs: - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-tests@actions_refactor with: matrix-name: "${{ matrix.entry.name }}" - matrix-pthon: "${{ matrix.entry.python }}" + matrix-python: "${{ matrix.entry.python }}" From aa3d6b375ac2d8772b34fe0594f367339ec81907 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 21:28:28 +0530 Subject: [PATCH 11/19] update Signed-off-by: NilashishC --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d745b8737..6ae3e5e04 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ on: # yamllint disable-line rule:truthy - cron: '0 0 * * *' jobs: - tox-matrix: + build-tox-matrix: runs-on: ubuntu-latest steps: - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor @@ -24,11 +24,11 @@ jobs: outputs: envlist: "${{ steps.build-matrix.outputs.envlist }}" run-tests: - needs: tox-matrix + needs: build-tox-matrix strategy: fail-fast: false matrix: - entry: "${{ fromJson(needs.tox-matrix.outputs.envlist) }}" + entry: "${{ fromJson(needs.build-tox-matrix.outputs.envlist) }}" name: "${{ matrix.entry.name }}" runs-on: ubuntu-latest steps: From e684df48b9bc9296de0d9ff9436e4af52c464c2b Mon Sep 17 00:00:00 2001 From: NilashishC Date: Fri, 29 Mar 2024 21:42:05 +0530 Subject: [PATCH 12/19] update Signed-off-by: NilashishC --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6ae3e5e04..edd2b6424 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: scope: unit outputs: envlist: "${{ steps.build-matrix.outputs.envlist }}" - run-tests: + run-unit-galaxy: needs: build-tox-matrix strategy: fail-fast: false @@ -35,4 +35,3 @@ jobs: - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-tests@actions_refactor with: matrix-name: "${{ matrix.entry.name }}" - matrix-python: "${{ matrix.entry.python }}" From b73f4918b892e8c485b4489558b20941735237da Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 1 Apr 2024 09:17:44 +0530 Subject: [PATCH 13/19] sanity Signed-off-by: NilashishC --- .github/workflows/tests.yml | 44 ++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edd2b6424..1d2d594f6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,24 +14,58 @@ on: # yamllint disable-line rule:truthy - cron: '0 0 * * *' jobs: - build-tox-matrix: + build-tox-matrix-unit: runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor - id: build-matrix + id: build-matrix-unit with: scope: unit outputs: - envlist: "${{ steps.build-matrix.outputs.envlist }}" + envlist: "${{ steps.build-matrix-unit.outputs.envlist }}" run-unit-galaxy: - needs: build-tox-matrix + needs: build-tox-matrix-unit strategy: fail-fast: false matrix: - entry: "${{ fromJson(needs.build-tox-matrix.outputs.envlist) }}" + entry: "${{ fromJson(needs.build-tox-matrix-unit.outputs.envlist) }}" name: "${{ matrix.entry.name }}" runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-tests@actions_refactor with: matrix-name: "${{ matrix.entry.name }}" + + build-tox-matrix-sanity: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor + id: build-matrix-sanity + with: + scope: sanity + outputs: + envlist: "${{ steps.build-matrix-sanity.outputs.envlist }}" + run-sanity: + needs: build-tox-matrix-sanity + strategy: + fail-fast: false + matrix: + entry: "${{ fromJson(needs.build-tox-matrix-sanity.outputs.envlist) }}" + name: "${{ matrix.entry.name }}" + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: NilashishC/ansible-content-actions/.github/actions/run-sanity@actions_refactor + with: + matrix-name: "${{ matrix.entry.name }}" From 644cc4bfe216d8a8baa2895559ad48a668bcd530 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 1 Apr 2024 09:35:07 +0530 Subject: [PATCH 14/19] updates Signed-off-by: NilashishC --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d2d594f6..fc640da1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,9 +38,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-tests@actions_refactor + - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-galaxy@actions_refactor with: - matrix-name: "${{ matrix.entry.name }}" + test-env: "${{ matrix.entry.name }}" build-tox-matrix-sanity: runs-on: ubuntu-latest @@ -68,4 +68,4 @@ jobs: - uses: NilashishC/ansible-content-actions/.github/actions/run-sanity@actions_refactor with: - matrix-name: "${{ matrix.entry.name }}" + test-env: "${{ matrix.entry.name }}" From 0db4769d9a299cebc83f2fe5e116dc255bdcaf07 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 1 Apr 2024 09:49:02 +0530 Subject: [PATCH 15/19] Updates Signed-off-by: NilashishC --- .github/workflows/tests.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fc640da1e..49a133bd2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,3 @@ - --- name: "CI" @@ -20,7 +19,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor + - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor # yamllint disable-line rule:line-length id: build-matrix-unit with: scope: unit @@ -38,7 +37,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-galaxy@actions_refactor + - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-galaxy@actions_refactor # yamllint disable-line rule:line-length with: test-env: "${{ matrix.entry.name }}" @@ -48,7 +47,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor + - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor # yamllint disable-line rule:line-length id: build-matrix-sanity with: scope: sanity @@ -66,6 +65,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: NilashishC/ansible-content-actions/.github/actions/run-sanity@actions_refactor + - uses: NilashishC/ansible-content-actions/.github/actions/run-sanity@actions_refactor # yamllint disable-line rule:line-length with: test-env: "${{ matrix.entry.name }}" From 5d0300e197d4523fdbb72b834db1859284966ddd Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 1 Apr 2024 10:27:23 +0530 Subject: [PATCH 16/19] lint Signed-off-by: NilashishC --- .github/workflows/tests.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 49a133bd2..2660183bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,16 @@ on: # yamllint disable-line rule:truthy - cron: '0 0 * * *' jobs: + build-import: + uses: ansible/ansible-content-actions/.github/workflows/build_import.yaml@main + + unit-source: + uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main + with: + collection_pre_install: >- + git+https://github.com/ansible-collections/ansible.utils.git + git+https://github.com/ansible-collections/ansible.netcommon.git + build-tox-matrix-unit: runs-on: ubuntu-latest steps: @@ -68,3 +78,31 @@ jobs: - uses: NilashishC/ansible-content-actions/.github/actions/run-sanity@actions_refactor # yamllint disable-line rule:line-length with: test-env: "${{ matrix.entry.name }}" + + ansible-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: NilashishC/ansible-content-actions/.github/actions/run-ansible-lint@actions_refactor # yamllint disable-line rule:line-length + + all_green: + if: ${{ always() }} + needs: + - build-import + - run-sanity + - run-unit-galaxy + - unit-source + - ansible-lint + runs-on: ubuntu-latest + steps: + - run: >- + python -c "assert 'failure' not in + set([ + '${{ needs.build-import.result }}', + '${{ needs.run-sanity.result }}', + '${{ needs.run-unit-galaxy.result }}' + '${{ needs.ansible-lint.result }}' + '${{ needs.unit-source.result }}' + ])" From 61a3aff60ae16926d6dc25eb3de70c0e195d1360 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 1 Apr 2024 10:30:09 +0530 Subject: [PATCH 17/19] lint Signed-off-by: NilashishC --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2660183bf..fe0459616 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,7 @@ jobs: - uses: NilashishC/ansible-content-actions/.github/actions/run-sanity@actions_refactor # yamllint disable-line rule:line-length with: test-env: "${{ matrix.entry.name }}" - + ansible-lint: runs-on: ubuntu-latest steps: From 5c1bcca9612a5b7455444332b16783e57bbde8f2 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 1 Apr 2024 10:50:28 +0530 Subject: [PATCH 18/19] lint Signed-off-by: NilashishC --- .github/workflows/tests.yml | 46 ++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fe0459616..eb667d635 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,14 +16,7 @@ jobs: build-import: uses: ansible/ansible-content-actions/.github/workflows/build_import.yaml@main - unit-source: - uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main - with: - collection_pre_install: >- - git+https://github.com/ansible-collections/ansible.utils.git - git+https://github.com/ansible-collections/ansible.netcommon.git - - build-tox-matrix-unit: + build-tox-matrix: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -33,14 +26,21 @@ jobs: id: build-matrix-unit with: scope: unit + + - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor # yamllint disable-line rule:line-length + id: build-matrix-sanity + with: + scope: sanity outputs: - envlist: "${{ steps.build-matrix-unit.outputs.envlist }}" + unit-envlist: "${{ steps.build-matrix-unit.outputs.envlist }}" + sanity-envlist: "${{ steps.build-matrix-sanity.outputs.envlist }}" + run-unit-galaxy: - needs: build-tox-matrix-unit + needs: build-tox-matrix strategy: fail-fast: false matrix: - entry: "${{ fromJson(needs.build-tox-matrix-unit.outputs.envlist) }}" + entry: "${{ fromJson(needs.build-tox-matrix.outputs.unit-envlist) }}" name: "${{ matrix.entry.name }}" runs-on: ubuntu-latest steps: @@ -50,25 +50,12 @@ jobs: - uses: NilashishC/ansible-content-actions/.github/actions/run-unit-galaxy@actions_refactor # yamllint disable-line rule:line-length with: test-env: "${{ matrix.entry.name }}" - - build-tox-matrix-sanity: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: NilashishC/ansible-content-actions/.github/actions/generate-tox-ansible-matrix@actions_refactor # yamllint disable-line rule:line-length - id: build-matrix-sanity - with: - scope: sanity - outputs: - envlist: "${{ steps.build-matrix-sanity.outputs.envlist }}" run-sanity: - needs: build-tox-matrix-sanity + needs: build-tox-matrix strategy: fail-fast: false matrix: - entry: "${{ fromJson(needs.build-tox-matrix-sanity.outputs.envlist) }}" + entry: "${{ fromJson(needs.build-tox-matrix.outputs.sanity-envlist) }}" name: "${{ matrix.entry.name }}" runs-on: ubuntu-latest steps: @@ -87,6 +74,13 @@ jobs: - uses: NilashishC/ansible-content-actions/.github/actions/run-ansible-lint@actions_refactor # yamllint disable-line rule:line-length + unit-source: + uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main + with: + collection_pre_install: >- + git+https://github.com/ansible-collections/ansible.utils.git + git+https://github.com/ansible-collections/ansible.netcommon.git + all_green: if: ${{ always() }} needs: From 36325fa4ef8fc722d413d40c8fcda8d67e7e0e38 Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 1 Apr 2024 10:58:17 +0530 Subject: [PATCH 19/19] lint Signed-off-by: NilashishC --- .github/workflows/tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb667d635..f6fcb7080 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,12 @@ on: # yamllint disable-line rule:truthy jobs: build-import: - uses: ansible/ansible-content-actions/.github/workflows/build_import.yaml@main + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: NilashishC/ansible-content-actions/.github/actions/build-import@actions_refactor build-tox-matrix: runs-on: ubuntu-latest