Skip to content

dcnm_vrf fix issues #351, #356, #357 #1426

dcnm_vrf fix issues #351, #356, #357

dcnm_vrf fix issues #351, #356, #357 #1426

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Build DCNM collection
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.15.12, 2.16.7]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python "3.10"
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Build a DCNM collection tarball
run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/v${{ matrix.ansible }}/collection-tarballs"
- name: Store migrated collection artifacts
uses: actions/[email protected]
with:
name: collection_v${{ matrix.ansible }}
path: .cache/v${{ matrix.ansible }}/collection-tarballs
overwrite: true
sanity:
name: Run ansible-sanity tests
needs:
- build
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.15.12, 2.16.7]
python: ["3.9", "3.10", "3.11"]
exclude:
- ansible: 2.16.7
python: "3.9"
steps:
- name: Set up Python (v${{ matrix.python }})
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Download migrated collection artifacts
uses: actions/[email protected]
with:
name: collection_v${{ matrix.ansible }}
path: .cache/v${{ matrix.ansible }}/collection-tarballs
- name: Install the collection tarball
run: ansible-galaxy collection install .cache/v${{ matrix.ansible }}/collection-tarballs/*.tar.gz
- name: Run sanity tests
run: ansible-test sanity --docker --python ${{matrix.python}} -v --color --truncate 0
working-directory: /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
unit-tests:
name: Run DCNM Unit Tests
needs:
- build
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.15.12, 2.16.7]
steps:
- name: Set up Python "3.10"
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Install coverage (v7.3.4)
run: pip install coverage==7.3.4
- name: Install pytest (v7.4.4)
run: pip install pytest==7.4.4
- name: Download migrated collection artifacts
uses: actions/[email protected]
with:
name: collection_v${{ matrix.ansible }}
path: .cache/v${{ matrix.ansible }}/collection-tarballs
- name: Install the collection tarball
run: ansible-galaxy collection install .cache/v${{ matrix.ansible }}/collection-tarballs/*.tar.gz
- name: Run DCNM Unit tests
run: coverage run --source=. -m pytest tests/unit/. -vvvv
working-directory: /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
env:
PYTHONPATH: /home/runner/.ansible/collections
- name: Generate coverage report
run: coverage report
working-directory: /home/runner/.ansible/collections/ansible_collections/cisco/dcnm