Skip to content

Commit

Permalink
Merge branch 'master' into feature-vlan
Browse files Browse the repository at this point in the history
  • Loading branch information
JkhatriInfobox authored Nov 18, 2024
2 parents 3c5c7ab + 930f895 commit d5f6ede
Show file tree
Hide file tree
Showing 216 changed files with 7,941 additions and 1,196 deletions.
107 changes: 62 additions & 45 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ jobs:
strategy:
fail-fast: false
matrix:
ansible-version: [stable-2.10]
ansible-version: [stable-2.15]
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.11'

- name: Install ansible (${{ matrix.ansible-version }})
run: pip install pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check

- name: Build a collection tarball
run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs"

- name: Store migrated collection artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: collection
path: .cache/collection-tarballs


###
# Unit tests
Expand All @@ -48,40 +48,42 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.8, 3.9]
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, devel]
python-version: ['3.9', '3.10', '3.11', '3.12']
ansible-version: [stable-2.15, stable-2.16, stable-2.17, devel]
exclude:
- ansible-version: devel
python-version: 2.7
python-version: '3.11'
- ansible-version: devel
python-version: 3.8
- ansible-version: stable-2.12
python-version: 2.7
- ansible-version: stable-2.13
python-version: 2.7
- ansible-version: stable-2.9
python-version: 3.9
python-version: '3.10'
- ansible-version: devel
python-version: '3.9'
- ansible-version: stable-2.17
python-version: '3.9'
- ansible-version: stable-2.16
python-version: '3.9'
- ansible-version: stable-2.15
python-version: '3.12'

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install ansible (${{ matrix.ansible-version }}) version
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check

- name: Download migrated collection artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: collection
path: .cache/collection-tarballs

- name: Setup Unit test Pre-requisites
run: |
ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
git clone https://github.com/ansible/ansible.git
cp -rf ansible/test/units/compat /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/
git clone https://github.com/ansible/ansible.git -b ${{ matrix.ansible-version }}
if [ "${{ matrix.ansible-version }}" != "devel" ] && [ "${{ matrix.ansible-version }}" != "stable-2.17" ]; then cp -rf ansible/test/units/compat /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/; fi
cp -rf ansible/test/units/modules/utils.py /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/plugins/modules/
sed -i 's/units/ansible_collections.infoblox.nios_modules.tests.unit/' /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/plugins/modules/utils.py
if [ -f /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/requirements.txt ]; then pip install -r /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/requirements.txt; fi
Expand All @@ -91,7 +93,11 @@ jobs:

- name: Generate coverage report
run: |
if [ "${{ matrix.ansible-version }}" == "devel" ]; then pip install coverage==6.5.0; fi
if [ "${{ matrix.ansible-version }}" == "devel" ]; then
pip install coverage==7.6.1;
elif [ "${{ matrix.ansible-version }}" == "stable-2.15" ]; then
pip install coverage==6.5.0;
fi
ansible-test coverage xml -v --group-by command --group-by version
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/

Expand All @@ -108,34 +114,45 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.8, 3.9]
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, devel]
python-version: ['3.9', '3.10', '3.11', '3.12']
ansible-version: [stable-2.15, stable-2.16, stable-2.17, devel]
exclude:
- ansible-version: stable-2.9
python-version: 3.9
- ansible-version: devel
python-version: '3.11'
- ansible-version: devel
python-version: '3.10'
- ansible-version: devel
python-version: '3.9'
- ansible-version: stable-2.17
python-version: '3.9'
- ansible-version: stable-2.16
python-version: '3.9'
- ansible-version: stable-2.15
python-version: '3.12'
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}

- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install ansible-base (${{ matrix.ansible }})
- name: Install ansible-base (${{ matrix.ansible-version }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check

- name: Download migrated collection artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: collection
path: .cache/collection-tarball

- name: Install the collection tarball
run: ansible-galaxy collection install .cache/collection-tarball/*.tar.gz

- name: Setup Integration test Pre-requisites
run: |
sudo apt-get update
sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0
pip install -r /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/requirements.txt
Expand All @@ -145,19 +162,19 @@ jobs:
echo $ANSIBLE_NIOSSIM_CONTAINER
ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python-version }} --docker --coverage
env:
ANSIBLE_NIOSSIM_CONTAINER: quay.io/ansible/nios-test-container:1.4.0
ANSIBLE_NIOSSIM_CONTAINER: quay.io/ansible/nios-test-container:6.0.0
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/

# ansible-test support producing code coverage date
- name: Generate coverage report
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/

- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false


###
# Sanity tests (REQUIRED)
#
Expand All @@ -170,21 +187,21 @@ jobs:
strategy:
fail-fast: false
matrix:
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, devel]
ansible-version: [stable-2.15, stable-2.16, stable-2.17, devel]

steps:
- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
# it is just required to run that once as "ansible-test sanity" in the docker image
# will run on all python versions it supports.
python-version: 3.9
python-version: 3.11

- name: Install ansible (${{ matrix.ansible-version }}) version
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check

- name: Download migrated collection artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: collection
path: .cache/collection-tarballs
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
.direnv/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -99,3 +100,10 @@ ENV/

# mypy
.mypy_cache/
infoblox-ansible.code-workspace

# Ansible sanity test ouput
**/ansible-test-sanity-*.json

# Dev tools
.vscode/
Loading

0 comments on commit d5f6ede

Please sign in to comment.