| 1 |
--- |
| 2 |
name: plugins-integration |
| 3 |
on: |
| 4 |
push: |
| 5 |
paths: |
| 6 |
- "plugins/**" |
| 7 |
- "tests/integration/**" |
| 8 |
- ".github/workflows/plugins-integration.yml" |
| 9 |
pull_request: |
| 10 |
paths: |
| 11 |
- "plugins/**" |
| 12 |
- "tests/integration/**" |
| 13 |
- ".github/workflows/plugins-integration.yml" |
| 14 |
|
| 15 |
jobs: |
| 16 |
integration: |
| 17 |
runs-on: ubuntu-latest |
| 18 |
name: I (${{ matrix.zabbix_container.version}} Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}}) |
| 19 |
strategy: |
| 20 |
fail-fast: false |
| 21 |
matrix: |
| 22 |
zabbix_container: |
| 23 |
- version: "6.0" |
| 24 |
- version: "7.0" |
| 25 |
- version: "7.2" |
| 26 |
- version: "7.4" |
| 27 |
ansible: |
| 28 |
# https://docs.ansible.com/projects/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-changelogs |
| 29 |
- stable-2.16 |
| 30 |
- stable-2.17 |
| 31 |
- stable-2.18 |
| 32 |
- stable-2.19 |
| 33 |
- stable-2.20 |
| 34 |
- devel |
| 35 |
python: |
| 36 |
- '3.10' |
| 37 |
- '3.11' |
| 38 |
- '3.12' |
| 39 |
- '3.13' |
| 40 |
- '3.14' |
| 41 |
exclude: |
| 42 |
- ansible: stable-2.20 |
| 43 |
python: '3.11' |
| 44 |
- ansible: stable-2.20 |
| 45 |
python: '3.10' |
| 46 |
- ansible: stable-2.19 |
| 47 |
python: '3.14' |
| 48 |
- ansible: stable-2.19 |
| 49 |
python: '3.10' |
| 50 |
- ansible: stable-2.18 |
| 51 |
python: '3.14' |
| 52 |
- ansible: stable-2.18 |
| 53 |
python: '3.10' |
| 54 |
- ansible: stable-2.17 |
| 55 |
python: '3.14' |
| 56 |
- ansible: stable-2.17 |
| 57 |
python: '3.13' |
| 58 |
- ansible: stable-2.16 |
| 59 |
python: '3.14' |
| 60 |
- ansible: stable-2.16 |
| 61 |
python: '3.13' |
| 62 |
- ansible: devel |
| 63 |
python: '3.10' |
| 64 |
- ansible: devel |
| 65 |
python: '3.11' |
| 66 |
|
| 67 |
steps: |
| 68 |
- name: Check out code |
| 69 |
uses: actions/checkout@v6 |
| 70 |
with: |
| 71 |
path: ansible_collections/community/zabbix |
| 72 |
|
| 73 |
- name: Set up Python ${{ matrix.python }} |
| 74 |
uses: actions/setup-python@v6 |
| 75 |
with: |
| 76 |
python-version: ${{ matrix.python }} |
| 77 |
|
| 78 |
- name: Install ansible-base (${{ matrix.ansible }}) |
| 79 |
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check |
| 80 |
|
| 81 |
- name: Install ansible.netcommon collection |
| 82 |
run: ansible-galaxy collection install ansible.netcommon -p $GITHUB_WORKSPACE |
| 83 |
working-directory: ./ansible_collections/community/zabbix |
| 84 |
|
| 85 |
# For Zabbix integration tests we need to test against different versions of |
| 86 |
# the Zabbix server. To do this we spin up a Docker container using the `matrix` |
| 87 |
# of version and ports specified earlier. |
| 88 |
- name: Zabbix container server provisioning |
| 89 |
uses: hoverkraft-tech/[email protected] |
| 90 |
with: |
| 91 |
compose-file: "./ansible_collections/community/zabbix/docker-compose.yml" |
| 92 |
env: |
| 93 |
zabbix_version: ${{ matrix.zabbix_container.version }} |
| 94 |
|
| 95 |
# Run the integration tests |
| 96 |
# As we need to connect to an existing docker container we can't use `--docker` here as the VMs would be on different |
| 97 |
# (non-routing) networks, so we run them locally and ensure any required dependencies are installed via `--requirements` |
| 98 |
- name: Run integration test |
| 99 |
run: ansible-test integration -v --color --continue-on-error --diff --python ${{ matrix.python }} --requirements --coverage |
| 100 |
working-directory: ./ansible_collections/community/zabbix |
| 101 |
|
| 102 |
# ansible-test support producing code coverage date |
| 103 |
- name: Generate coverage report |
| 104 |
run: ansible-test coverage xml -v --requirements --group-by command --group-by version |
| 105 |
working-directory: ./ansible_collections/community/zabbix |
| 106 |
|
| 107 |
# See the repots at https://codecov.io/gh/ansible-collections/community.zabbix |
| 108 |
- uses: codecov/codecov-action@v6 |
| 109 |
with: |
| 110 |
fail_ci_if_error: false |