From d5d612fef9ac510a74152c3ea21b84fcc7237d8e Mon Sep 17 00:00:00 2001 From: Sugetha Chandhrasekar Date: Tue, 13 Aug 2024 11:16:08 -0700 Subject: [PATCH 1/5] CI: Make CI better again --- .github/workflows/pull-request-management.yml | 35 +++++++++++++ .github/workflows/pull-request-releases.yml | 50 +++++++++---------- 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index d2f4ad2c4..c45a607d6 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -312,3 +312,38 @@ jobs: run: | cd ansible_collections/arista/cvp/ ansible-lint --force-color --strict -v + + # ----------------------------------- # + # Galaxy Importer + # ----------------------------------- # + galaxy_importer: + name: Test galaxy-importer + runs-on: ubuntu-20.04 # Older version to be compatible with old python + env: + PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + GALAXY_IMPORTER_CONFIG: galaxy-importer/galaxy-importer.cfg + steps: + - uses: actions/setup-python@v5 + with: + python-version: | + 3.10 + - uses: actions/checkout@v4 + - name: 'Install Python & Ansible requirements' + run: | + pip install -r ansible_collections/arista/cvp/requirements.txt -r ansible_collections/arista/cvp/requirements-dev.txt --upgrade + ansible-galaxy collection install -r ansible_collections/arista/cvp/collections.yml + - name: Install galaxy-importer + # Install the specific version of galaxy-importer used on galaxy.ansible.com + # The version conflicts with our requirements, + # so we let the galaxy-importer version resolve remaining requirements. + run: | + pip install "galaxy-importer==0.4.19" + - name: 'Build ansible package' + run: make collection-build + - name: 'Run galaxy-importer checks' + run: python -m galaxy_importer.main *.tar.gz + - uses: actions/upload-artifact@v3 + with: + name: importer-logs + path: ./importer_result.json diff --git a/.github/workflows/pull-request-releases.yml b/.github/workflows/pull-request-releases.yml index ae417994e..729d7fe5a 100644 --- a/.github/workflows/pull-request-releases.yml +++ b/.github/workflows/pull-request-releases.yml @@ -36,28 +36,28 @@ jobs: cd ansible_collections/arista/avd/ ansible-test sanity -v --requirements --docker --skip-test yamllint --exclude docs/ - galaxy_importer: - name: Test galaxy-importer - runs-on: ubuntu-latest - container: avdteam/base:3.8-v2.0 - needs: [ molecule_eos_designs ] - if: needs.cloudvision.status != 'failed' && needs.molecule_eos_designs.status != 'failed' && needs.file-changes.outputs.plugins == 'true' - env: - PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions - ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions - steps: - - name: 'set environment variables' - run: | - echo "PY_COLORS=1" >> $GITHUB_ENV - echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - - uses: actions/checkout@v2 - - name: install requirements - run: make install-requirements - - name: 'build ansible package' - run: make collection-build - - name: 'run ansible-importer checks' - run: python -m galaxy_importer.main *.tar.gz - - uses: actions/upload-artifact@v2 - with: - name: importer-logs - path: ./importer_result.json + # galaxy_importer: + # name: Test galaxy-importer + # runs-on: ubuntu-latest + # container: avdteam/base:3.8-v2.0 + # needs: [ molecule_eos_designs ] + # if: needs.cloudvision.status != 'failed' && needs.molecule_eos_designs.status != 'failed' && needs.file-changes.outputs.plugins == 'true' + # env: + # PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions + # ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions + # steps: + # - name: 'set environment variables' + # run: | + # echo "PY_COLORS=1" >> $GITHUB_ENV + # echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV + # - uses: actions/checkout@v2 + # - name: install requirements + # run: make install-requirements + # - name: 'build ansible package' + # run: make collection-build + # - name: 'run ansible-importer checks' + # run: python -m galaxy_importer.main *.tar.gz + # - uses: actions/upload-artifact@v2 + # with: + # name: importer-logs + # path: ./importer_result.json From dc77eb3ac08b7b12091ee39d69985b3eacd36db2 Mon Sep 17 00:00:00 2001 From: Sugetha Chandhrasekar Date: Tue, 13 Aug 2024 11:19:01 -0700 Subject: [PATCH 2/5] changed actions/checkout to use v4 --- .github/workflows/pull-request-management.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index c45a607d6..88682a420 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -20,7 +20,7 @@ jobs: docs: ${{ steps.filter.outputs.docs }} python: ${{ steps.filter.outputs.python }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 id: filter with: @@ -82,7 +82,7 @@ jobs: steps: # Removed as gh action is marked as deprecated # - uses: pre-commit/action@v2.0.2 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python 3 @@ -111,7 +111,7 @@ jobs: run: | echo "PY_COLORS=1" >> $GITHUB_ENV echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3 uses: actions/setup-python@v4 with: @@ -136,7 +136,7 @@ jobs: run: | echo "PY_COLORS=1" >> $GITHUB_ENV echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3 uses: actions/setup-python@v4 with: @@ -176,7 +176,7 @@ jobs: run: | echo "PY_COLORS=1" >> $GITHUB_ENV echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run molecule action uses: arista-netdevops-community/action-molecule-avd@v1.8.1 with: @@ -213,7 +213,7 @@ jobs: run: | echo "PY_COLORS=1" >> $GITHUB_ENV echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run molecule action uses: arista-netdevops-community/action-molecule-avd@v1.8.1 with: @@ -279,7 +279,7 @@ jobs: run: | echo "PY_COLORS=1" >> $GITHUB_ENV echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3 uses: actions/setup-python@v4 with: From 6b81109ee791689ac190f2c9d26920882a7b7ac6 Mon Sep 17 00:00:00 2001 From: Sugetha Chandhrasekar Date: Tue, 13 Aug 2024 11:22:33 -0700 Subject: [PATCH 3/5] updated several action versions --- .github/workflows/pull-request-management.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 88682a420..4d5f0dfeb 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -21,7 +21,7 @@ jobs: python: ${{ steps.filter.outputs.python }} steps: - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v2 + - uses: dorny/paths-filter@v3 id: filter with: filters: | @@ -86,7 +86,7 @@ jobs: with: fetch-depth: 0 - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' - name: Install requirements @@ -113,7 +113,7 @@ jobs: echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python_version }} - name: Test code compatibility @@ -138,7 +138,7 @@ jobs: echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python_version }} - name: Install requirements @@ -150,7 +150,7 @@ jobs: run: | cd tests/ make unit-tests - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: pytest-report path: | @@ -188,7 +188,7 @@ jobs: ansible: "${{ matrix.ansible_version }}" check_git: true check_git_enforced: false - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: molecule-${{ matrix.avd_scenario }}-artifacts path: ansible_collections/arista/cvp/molecule/${{ matrix.avd_scenario }} @@ -281,7 +281,7 @@ jobs: echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python_version }} - name: 'Install Python requirements' @@ -343,7 +343,7 @@ jobs: run: make collection-build - name: 'Run galaxy-importer checks' run: python -m galaxy_importer.main *.tar.gz - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: importer-logs path: ./importer_result.json From b563573ff9d6104045a91d5e9604d5704bc01c74 Mon Sep 17 00:00:00 2001 From: Sugetha Chandhrasekar Date: Tue, 13 Aug 2024 11:33:42 -0700 Subject: [PATCH 4/5] updated galaxy importer --- .github/workflows/pull-request-management.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 4d5f0dfeb..14a4b5fb4 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -63,6 +63,7 @@ jobs: - 'mkdocs.yml' - 'ansible_collections/arista/cvp/docs/**' - 'ansible_collections/arista/cvp/roles/**/README.md' + - 'ansible_collections/arista/cvp/index.md' - '.github/workflows/*' python: - 'ansible_collections/arista/cvp/plugins/**/*.py' @@ -150,7 +151,7 @@ jobs: run: | cd tests/ make unit-tests - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: name: pytest-report path: | @@ -188,7 +189,7 @@ jobs: ansible: "${{ matrix.ansible_version }}" check_git: true check_git_enforced: false - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: name: molecule-${{ matrix.avd_scenario }}-artifacts path: ansible_collections/arista/cvp/molecule/${{ matrix.avd_scenario }} @@ -338,12 +339,12 @@ jobs: # The version conflicts with our requirements, # so we let the galaxy-importer version resolve remaining requirements. run: | - pip install "galaxy-importer==0.4.19" + pip install "galaxy-importer==0.4.20" - name: 'Build ansible package' run: make collection-build - name: 'Run galaxy-importer checks' run: python -m galaxy_importer.main *.tar.gz - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: name: importer-logs path: ./importer_result.json From f30c06009fdaa9825cd7135763a9df1d37bcf0d0 Mon Sep 17 00:00:00 2001 From: Sugetha Chandhrasekar Date: Tue, 13 Aug 2024 11:36:00 -0700 Subject: [PATCH 5/5] updated ansible-core versions --- .github/workflows/pull-request-management.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-management.yml b/.github/workflows/pull-request-management.yml index 14a4b5fb4..9a9c77912 100644 --- a/.github/workflows/pull-request-management.yml +++ b/.github/workflows/pull-request-management.yml @@ -166,7 +166,7 @@ jobs: matrix: ansible_version: - 'ansible-core>=2.15.0,<2.18.0 --upgrade' - avd_scenario: + cvp_scenario: - cv_configlet_loose - cv_configlet_strict - cv_device @@ -183,7 +183,7 @@ jobs: with: molecule_parentdir: 'ansible_collections/arista/cvp' molecule_command: 'test' - molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + molecule_args: '--scenario-name ${{ matrix.cvp_scenario }}' pip_file: ansible_collections/arista/cvp/requirements.txt galaxy_file: "ansible_collections/arista/cvp/collections.yml" ansible: "${{ matrix.ansible_version }}" @@ -191,8 +191,8 @@ jobs: check_git_enforced: false - uses: actions/upload-artifact@v3 with: - name: molecule-${{ matrix.avd_scenario }}-artifacts - path: ansible_collections/arista/cvp/molecule/${{ matrix.avd_scenario }} + name: molecule-${{ matrix.cvp_scenario }}-artifacts + path: ansible_collections/arista/cvp/molecule/${{ matrix.cvp_scenario }} molecule_dhcp: name: Validate Roles for DHCP management @@ -200,10 +200,8 @@ jobs: strategy: fail-fast: true matrix: - # ansible_version: ['ansible-core==2.11.3', 'ansible-core>=2.11.3'] - # XXX: - ansible_version: ['ansible-core==2.15.0', 'ansible-core>=2.17.0'] - avd_scenario: + ansible_version: ['ansible-core==2.15.0', 'ansible-core<2.18.0'] + cvp_scenario: - dhcp_management_mac - dhcp_management_offline - dhcp_system_mac @@ -220,7 +218,7 @@ jobs: with: molecule_parentdir: 'ansible_collections/arista/cvp' molecule_command: 'test' - molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' + molecule_args: '--scenario-name ${{ matrix.cvp_scenario }}' pip_file: ansible_collections/arista/cvp/requirements.txt galaxy_file: "ansible_collections/arista/cvp/collections.yml" ansible: "${{ matrix.ansible_version }}"