From 81d0d919be3ed508cce367a19450bbc05fefb58a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Mar 2026 04:26:23 +0000 Subject: [PATCH 1/2] Initial plan From 392bb220c87685b445f70b6d20e5db5dcff3afb7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Mar 2026 04:30:40 +0000 Subject: [PATCH 2/2] Add GitHub Actions CI and Ansible lint workflows Co-authored-by: d3ej <6217461+d3ej@users.noreply.github.com> --- .github/workflows/ansible-lint.yml | 32 ++++++++++++++ .github/workflows/ci.yml | 68 ++++++++++++++++++++++++++++++ .yamllint.yml | 10 +++++ ansible/build.yml | 1 - ansible/deploy.yml | 2 +- containerlab/clab-topology.yml | 3 +- tests/test_fabric.py | 1 - 7 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ansible-lint.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .yamllint.yml diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml new file mode 100644 index 0000000..d5f9967 --- /dev/null +++ b/.github/workflows/ansible-lint.yml @@ -0,0 +1,32 @@ +name: Ansible Lint + +on: + push: + branches: [main, master] + paths: + - "ansible/**" + pull_request: + branches: [main, master] + paths: + - "ansible/**" + +jobs: + ansible-lint: + name: Ansible Lint + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install ansible-lint + run: pip install ansible-lint + + - name: Run ansible-lint + run: ansible-lint ansible/*.yml --exclude ansible/configs/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1e64feb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + lint-python: + name: Lint Python + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install flake8 + run: pip install flake8 + + - name: Run flake8 + run: flake8 tests/ --max-line-length=120 --extend-ignore=E501 + + lint-yaml: + name: Lint YAML + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install yamllint + run: pip install yamllint + + - name: Run yamllint + run: yamllint ansible/ containerlab/ + + test-collection: + name: Test Collection + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install test dependencies + run: pip install pytest netmiko paramiko + + - name: Collect tests (syntax check) + run: pytest tests/ --collect-only -q diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..5e86037 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,10 @@ +--- +extends: default + +rules: + line-length: + max: 150 + truthy: + allowed-values: ['true', 'false', 'yes', 'no'] + document-start: + level: warning diff --git a/ansible/build.yml b/ansible/build.yml index e3ee495..dcbc7d0 100644 --- a/ansible/build.yml +++ b/ansible/build.yml @@ -11,4 +11,3 @@ - name: Generate Device Configurations and Documentation ansible.builtin.import_role: name: arista.avd.eos_cli_config_gen - diff --git a/ansible/deploy.yml b/ansible/deploy.yml index 9ecf3b4..094b256 100644 --- a/ansible/deploy.yml +++ b/ansible/deploy.yml @@ -14,4 +14,4 @@ - name: Deploy Configurations to Devices ansible.builtin.import_role: - name: arista.avd.eos_config_deploy_eapi \ No newline at end of file + name: arista.avd.eos_config_deploy_eapi diff --git a/containerlab/clab-topology.yml b/containerlab/clab-topology.yml index d73d60b..d1f4874 100644 --- a/containerlab/clab-topology.yml +++ b/containerlab/clab-topology.yml @@ -1,3 +1,4 @@ +--- name: multi-dc-evpn topology: kinds: @@ -204,7 +205,7 @@ topology: exec: - ip addr add 192.168.140.20/24 dev eth1 - ip route add default via 192.168.140.8 - + graphite: kind: linux image: netreplica/graphite:latest diff --git a/tests/test_fabric.py b/tests/test_fabric.py index 798c364..51f5b35 100644 --- a/tests/test_fabric.py +++ b/tests/test_fabric.py @@ -5,7 +5,6 @@ import pytest from netmiko import ConnectHandler from paramiko.ssh_exception import SSHException, AuthenticationException -import time class NetworkFabric: