Files
offline_kubespray/collection/community/zabbix/.github/workflows/plugins-integration.yml
ByeonJungHun 360c6eef4a offline 작업
2024-02-19 16:02:29 +09:00

92 lines
3.4 KiB
YAML

---
name: plugins-integration
on:
push:
paths:
- 'plugins/**'
- 'tests/integration/**'
- '.github/workflows/plugins-integration.yml'
pull_request:
paths:
- 'plugins/**'
- 'tests/integration/**'
- '.github/workflows/plugins-integration.yml'
jobs:
integration:
runs-on: ubuntu-latest
name: I (${{ matrix.zabbix_container.version}} Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}})
strategy:
fail-fast: false
matrix:
zabbix_container:
- version: "4.0"
- version: "5.0"
# - version: "5.4" # only activate after basic compatibility
ansible:
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- devel
python:
- 2.7 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
- 3.6 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
- 3.9
exclude:
- ansible: devel
python: 2.7
- ansible: devel
python: 3.6
- ansible: stable-2.12
python: 2.7
- ansible: stable-2.12
python: 3.6
- ansible: stable-2.13
python: 2.7
- ansible: stable-2.13
python: 3.6
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/zabbix
- name: Set up Python ${{ matrix.ansible }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Install dependencies
run: pip install docker-compose zabbix-api
# For Zabbix integration tests we need to test against different versions of
# the Zabbix server. To do this we spin up a Docker container using the `matrix`
# of version and ports specified earlier.
- name: Zabbix container server provisioning
run: docker-compose up -d
working-directory: ./ansible_collections/community/zabbix
env:
zabbix_version: ${{ matrix.zabbix_container.version }}
# Run the integration tests
# As we need to connect to an existing docker container we can't use `--docker` here as the VMs would be on different
# (non-routing) networks, so we run them locally and ensure any required dependencies are installed via `--requirements`
- name: Run integration test
run: ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --requirements --coverage
working-directory: ./ansible_collections/community/zabbix
# 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: ./ansible_collections/community/zabbix
# See the repots at https://codecov.io/gh/ansible-collections/community.zabbix
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false