Fix(eos_config_deploy_cvp): Avoid duplicate AVD configlet (#3124) #7931
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Collection code testing" | |
on: pull_request | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
file-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
eos_design: ${{ steps.filter.outputs.eos_design }} | |
config_gen: ${{ steps.filter.outputs.config_gen }} | |
cloudvision: ${{ steps.filter.outputs.cloudvision }} | |
dhcp: ${{ steps.filter.outputs.dhcp }} | |
plugins: ${{ steps.filter.outputs.plugins }} | |
requirements: ${{ steps.filter.outputs.requirements }} | |
docs: ${{ steps.filter.outputs.docs }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
eos_design: | |
- 'ansible_collections/arista/avd/roles/eos_designs/*' | |
- 'ansible_collections/arista/avd/roles/eos_designs/**/*' | |
- '.github/workflows/pull-request-management.yml' | |
- 'ansible_collections/arista/avd/molecule/*' | |
- 'ansible_collections/arista/avd/molecule/**/*' | |
- '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' | |
- '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' | |
- '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' | |
- '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' | |
config_gen: | |
- 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*' | |
- 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*' | |
- '.github/workflows/pull-request-management.yml' | |
- 'ansible_collections/arista/avd/molecule/eos_cli_config_gen/*' | |
- 'ansible_collections/arista/avd/molecule/eos_cli_config_gen/**/*' | |
- 'ansible_collections/arista/avd/molecule/upgrade_eos_cli_config_gen/*' | |
- 'ansible_collections/arista/avd/molecule/upgrade_eos_cli_config_gen/**/*' | |
cloudvision: | |
- 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*' | |
- 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*' | |
- 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*' | |
- 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*' | |
- '.github/workflows/pull-request-management.yml' | |
dhcp: | |
- 'ansible_collections/arista/avd/roles/dhcp_provisioner/*' | |
- 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*' | |
- '.github/workflows/pull-request-management.yml' | |
plugins: | |
- 'ansible_collections/arista/avd/plugins/filter/**' | |
- 'ansible_collections/arista/avd/plugins/test/**' | |
requirements: | |
- 'ansible_collections/arista/avd/requirements.txt' | |
- 'ansible_collections/arista/avd/requirements-dev.txt' | |
- 'ansible_collections/arista/avd/meta/runtime.yml' | |
- '.github/workflows/pull-request-management.yml' | |
docs: | |
- '.github/workflows/pull-request-management.yml' | |
- 'mkdocs.yml' | |
- 'ansible_collections/arista/avd/docs/**' | |
- 'ansible_collections/arista/avd/roles/**/*.md' | |
- 'ansible_collections/arista/avd/**/*.md' | |
- 'ansible_collections/arista/avd/README.md' | |
- 'ansible_collections/arista/avd/**/*.schema.yml' | |
# ----------------------------------- # | |
# Pre Commit code validation | |
# ----------------------------------- # | |
pre_commit: | |
name: Run pre-commit validation hooks | |
runs-on: ubuntu-latest | |
needs: file-changes | |
if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' || needs.file-changes.outputs.requirements == 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install requirements | |
run: | | |
pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade | |
pip install -r ansible_collections/arista/avd/requirements.txt --upgrade | |
- name: Run pre-commit | |
run: | | |
pre-commit run --all-files --color always | |
# ----------------------------------- # | |
# Check Links offline for dead target | |
# ----------------------------------- # | |
offline_link_check: | |
name: 'Validate mkdoc content' | |
runs-on: ubuntu-latest | |
needs: [ file-changes ] | |
if: needs.file-changes.outputs.docs == 'true' | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Start docker-compose stack' | |
run: | | |
docker-compose -f development/docker-compose.yml up -d webdoc_avd | |
docker-compose -f development/docker-compose.yml ps | |
- name: 'Test connectivity to mkdoc server' | |
run: | | |
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:8000)" != "200" ]]; do sleep 5; done' | |
- name: Check links for 404 | |
run: | | |
docker run --network container:webdoc_avd raviqqe/muffet:2.6.1 http://127.0.0.1:8000/ -e ".*fonts.googleapis.com.*" -e ".*fonts.gstatic.com.*" -e ".*tools.ietf.org.*" -e ".*edit.*" -e ".*docs.github.com.*" -e "twitter.com" -e "www.docker.com" -f --max-redirections=3 --timeout=30 --rate-limit=1 | |
- name: 'Stop docker-compose stack' | |
run: | | |
docker-compose -f development/docker-compose.yml down | |
# -------------------------------- # | |
# Verify role documentation | |
# -------------------------------- # | |
verify_role_documentation: | |
name: Verify role documentation | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
avd_scenario: ['build_schemas_and_docs'] | |
ansible_version: ['ansible-core>=2.11.3,<2.15.0,!=2.12.0,!=2.12.1,!=2.12.2,!=2.12.3,!=2.12.4,!=2.12.5,!=2.13.0'] | |
needs: [ pre_commit ] | |
if: needs.file-changes.outputs.docs == 'true' | |
steps: | |
- name: 'set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Run molecule action | |
uses: arista-netdevops-community/[email protected] | |
with: | |
molecule_parentdir: 'ansible_collections/arista/avd' | |
molecule_command: 'test' | |
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' | |
pip_file: ansible_collections/arista/avd/requirements.txt | |
ansible: ${{ matrix.ansible_version }} | |
check_git: true | |
check_git_enforced: true | |
# ----------------------------------- # | |
# Test Requirements | |
# ----------------------------------- # | |
python_requirements: | |
name: Test Python requirements installation | |
runs-on: ubuntu-latest | |
needs: [ pre_commit ] | |
if: needs.file-changes.outputs.requirements == 'true' | |
strategy: | |
fail-fast: true | |
matrix: | |
python_version: [ "3.8", "3.9", "3.10" ] | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: 'Install Python requirements' | |
run: | | |
pip install -r ansible_collections/arista/avd/requirements.txt --upgrade | |
pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade | |
# ----------------------------------- # | |
# EOS CLI CONFIG GEN MOLECULE | |
# ----------------------------------- # | |
molecule_eos_cli_config_gen: | |
name: Validate eos_cli_config_gen | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
avd_scenario: | |
- 'eos_cli_config_gen' | |
- 'upgrade_eos_cli_config_gen' | |
- 'eos_cli_config_gen_v4.0' | |
ansible_version: | |
- 'ansible-core>=2.11.3,<2.15.0,!=2.12.0,!=2.12.1,!=2.12.2,!=2.12.3,!=2.12.4,!=2.12.5,!=2.13.0' | |
# Also test minimum ansible version for one scenario. | |
include: | |
- avd_scenario: 'eos_cli_config_gen' | |
ansible_version: 'ansible-core==2.11.3' | |
needs: [ pre_commit ] | |
if: needs.file-changes.outputs.config_gen == 'true' | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Run molecule action | |
uses: arista-netdevops-community/[email protected] | |
with: | |
molecule_parentdir: 'ansible_collections/arista/avd' | |
molecule_command: 'test' | |
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' | |
pip_file: ansible_collections/arista/avd/requirements.txt | |
galaxy_file: "ansible_collections/arista/avd/collections.yml" | |
ansible: ${{ matrix.ansible_version }} | |
check_git: true | |
check_git_enforced: true | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: molecule-${{ matrix.avd_scenario }}-artifacts | |
# path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} | |
# ----------------------------------- # | |
# DHCP PROVISIONNER MOLECULE | |
# ----------------------------------- # | |
molecule_dhcp_provisionner: | |
name: Validate DHCP configuration | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
avd_scenario: ['dhcp_configuration', 'dhcp_provisioning'] | |
ansible_version: ['ansible-core>=2.11.3,<2.15.0,!=2.12.0,!=2.12.1,!=2.12.2,!=2.12.3,!=2.12.4,!=2.12.5,!=2.13.0'] | |
needs: [ pre_commit ] | |
if: needs.file-changes.outputs.dhcp == 'true' | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Run molecule action | |
uses: arista-netdevops-community/[email protected] | |
with: | |
molecule_parentdir: 'ansible_collections/arista/avd' | |
molecule_command: 'test' | |
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' | |
pip_file: ansible_collections/arista/avd/requirements.txt | |
galaxy_file: "ansible_collections/arista/avd/collections.yml" | |
ansible: ${{ matrix.ansible_version }} | |
check_git: true | |
check_git_enforced: true | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: molecule-${{ matrix.avd_scenario }}-artifacts | |
# path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} | |
# ----------------------------------- # | |
# EOS Design MOLECULE | |
# ----------------------------------- # | |
molecule_eos_designs: | |
name: Validate eos_designs | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
avd_scenario: | |
- 'eos_designs_unit_tests' | |
- 'eos_designs_unit_tests_v4.0' | |
- 'evpn_underlay_ebgp_overlay_ebgp' | |
- 'evpn_underlay_ospf_overlay_ebgp' | |
- 'evpn_underlay_isis_overlay_ibgp' | |
- 'eos_designs-twodc-5stage-clos' | |
- 'evpn_underlay_rfc5549_overlay_ebgp' | |
- 'eos_designs-l2ls' | |
- 'eos_designs-mpls-isis-sr-ldp' | |
- 'upgrade_v2.x_to_v3.0_evpn_underlay_ebgp_overlay_ebgp' | |
- 'upgrade_v2.x_to_v3.0_evpn_underlay_ospf_overlay_ebgp' | |
- 'upgrade_v2.x_to_v3.0_evpn_underlay_isis_overlay_ibgp' | |
- 'upgrade_v2.x_to_v3.0_eos_designs-twodc-5stage-clos' | |
- 'upgrade_v2.x_to_v3.0_evpn_underlay_rfc5549_overlay_ebgp' | |
- 'example-campus-fabric' | |
- 'example-l2ls-fabric' | |
- 'example-single-dc-l3ls' | |
ansible_version: | |
- 'ansible-core>=2.11.3,<2.15.0,!=2.12.0,!=2.12.1,!=2.12.2,!=2.12.3,!=2.12.4,!=2.12.5,!=2.13.0' | |
# Also test with minimum and all other major versions | |
include: | |
- avd_scenario: 'eos_designs_unit_tests' | |
ansible_version: 'ansible-core==2.11.3' | |
- avd_scenario: 'eos_designs_unit_tests' | |
ansible_version: 'ansible-core>=2.12.6,<2.13.0' | |
- avd_scenario: 'eos_designs_unit_tests' | |
ansible_version: 'ansible-core>=2.13.1,<2.14.0' | |
needs: [ pre_commit ] | |
if: needs.file-changes.outputs.eos_design == 'true' || needs.file-changes.outputs.config_gen == 'true' | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Run molecule action | |
uses: arista-netdevops-community/[email protected] | |
with: | |
molecule_parentdir: 'ansible_collections/arista/avd' | |
molecule_command: 'test' | |
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' | |
pip_file: ansible_collections/arista/avd/requirements.txt | |
galaxy_file: "ansible_collections/arista/avd/collections.yml" | |
ansible: ${{ matrix.ansible_version }} | |
check_git: true | |
check_git_enforced: true | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: molecule-${{ matrix.avd_scenario }}-artifacts | |
# path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} | |
# ----------------------------------- # | |
# Cloudvision MOLECULE | |
# ----------------------------------- # | |
molecule_cloudvision: | |
name: Validate cvp_collection | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
avd_scenario: ['eos_config_deploy_cvp'] | |
ansible_version: ['ansible-core==2.11.3', 'ansible-core>=2.12.6,<2.15.0,!=2.13.0'] | |
needs: [ pre_commit ] | |
if: needs.file-changes.outputs.cloudvision == 'true' | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Run molecule action | |
uses: arista-netdevops-community/[email protected] | |
with: | |
molecule_parentdir: 'ansible_collections/arista/avd' | |
molecule_command: 'test' | |
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}' | |
pip_file: ansible_collections/arista/avd/requirements.txt | |
galaxy_file: "ansible_collections/arista/avd/collections.yml" | |
ansible: ${{ matrix.ansible_version }} | |
check_git: true | |
check_git_enforced: true | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: molecule-${{ matrix.avd_scenario }}-artifacts | |
# path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }} | |
# ----------------------------------- # | |
# Ansible tests | |
# ----------------------------------- # | |
ansible_test_sanity: | |
name: Run ansible-test sanity validation | |
runs-on: ubuntu-latest | |
needs: [ pre_commit ] | |
#needs: [ molecule_eos_designs, molecule_cloudvision ] | |
#if: needs.cloudvision.status != 'failed' && needs.molecule_eos_designs.status != 'failed' && needs.file-changes.outputs.plugins == 'true' | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: 'Install Python requirements' | |
run: | | |
pip install -r ansible_collections/arista/avd/requirements.txt --upgrade | |
pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade | |
- name: 'Run ansible-test sanity' | |
run: | | |
cd ansible_collections/arista/avd/ | |
ansible-test sanity --color yes -v --requirements --docker | |
ansible_test_units: | |
name: Run ansible-test units test cases | |
runs-on: ubuntu-latest | |
needs: [ pre_commit ] | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: 'Install Python requirements' | |
run: | | |
pip install -r ansible_collections/arista/avd/requirements.txt --upgrade | |
pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade | |
- name: 'Run ansible-test units test cases' | |
run: | | |
cd ansible_collections/arista/avd/ | |
ansible-test units --requirements --docker -vv | |
ansible_test_integration: | |
name: Run ansible-test integration test cases | |
runs-on: ubuntu-latest | |
needs: [ pre_commit ] | |
steps: | |
- name: 'Set environment variables' | |
run: | | |
echo "PY_COLORS=1" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: 'Install Python requirements' | |
run: | | |
pip install -r ansible_collections/arista/avd/requirements.txt --upgrade | |
pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade | |
- name: 'Run ansible-test integration test cases' | |
run: | | |
cd ansible_collections/arista/avd/ | |
ansible-test integration --requirements --docker -vv | |
# ----------------------------------- # | |
# Galaxy Importer | |
# ----------------------------------- # | |
galaxy_importer: | |
name: Test galaxy-importer | |
runs-on: ubuntu-latest | |
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@v3 | |
- name: Install requirements | |
run: | | |
pip install -r ansible_collections/arista/avd/requirements.txt --upgrade | |
pip install -r ansible_collections/arista/avd/requirements-dev.txt --upgrade | |
- 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 |