--- name: CI on: push: branches: [main] pull_request: env: COLLECTION_PATH: ansible_collections/vyos/blueprints jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: path: ${{ env.COLLECTION_PATH }} - uses: actions/setup-python@v5 with: python-version: "3.12" - run: pip install ansible-core ansible-lint - name: Install dependencies run: ansible-galaxy collection install -r ${{ env.COLLECTION_PATH }}/tests/requirements.yml -p . - name: ansible-lint working-directory: ${{ env.COLLECTION_PATH }} env: ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }} run: ansible-lint - name: Role docs render env: ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }} run: | for r in $(ls ${{ env.COLLECTION_PATH }}/roles); do ansible-doc -t role vyos.blueprints.$r > /dev/null done render: # Tier 1: no device. Renders every role and diffs against golden commands. runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: path: ${{ env.COLLECTION_PATH }} - uses: actions/setup-python@v5 with: python-version: "3.12" - run: pip install ansible-core ansible-pylibssh - run: ansible-galaxy collection install -r ${{ env.COLLECTION_PATH }}/tests/requirements.yml -p . - name: Render tests env: ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }} run: ${{ env.COLLECTION_PATH }}/tests/render/run.sh molecule: # Tier 2: containerized VyOS. Needs repository variable VYOS_ISO_URL. needs: [lint, render] if: ${{ vars.VYOS_ISO_URL != '' }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: scenario: [base, edge_nat, ha_vrrp, ospf_unnumbered, bgp_unnumbered, zone_firewall, vrf_firewall, bridge_firewall, ipsec_route_based, ipsec_policy_based, policy_ipsec_firewall, gre_tunnel, ipsec_route_based_bgp, ipsec_route_based_bgp_dual, ipsec_route_based_gcp, ha_walkthrough, ha_walkthrough_ospf, ha_walkthrough_bgp, inter_vrf, wan_load_balance, pppoe_ipv6, qos, isis_segment_routing, l3vpn_hub_and_spoke, l2tp_lns, dmvpn, management] steps: - uses: actions/checkout@v4 with: path: ${{ env.COLLECTION_PATH }} - uses: actions/setup-python@v5 with: python-version: "3.12" - run: pip install ansible-core ansible-pylibssh molecule - run: ansible-galaxy collection install -r ${{ env.COLLECTION_PATH }}/tests/requirements.yml -p . - name: Install containerlab and image tools run: | bash -c "$(curl -sL https://get.containerlab.dev)" sudo apt-get update && sudo apt-get install -y libarchive-tools squashfs-tools-ng - name: Build VyOS image run: ${{ env.COLLECTION_PATH }}/scripts/build-vyos-image.sh "${{ vars.VYOS_ISO_URL }}" vyos:blueprints-ci - name: molecule test working-directory: ${{ env.COLLECTION_PATH }}/extensions env: ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }} VYOS_IMAGE: vyos:blueprints-ci run: molecule test -s ${{ matrix.scenario }}