79 lines
2.5 KiB
YAML
79 lines
2.5 KiB
YAML
---
|
|
name: "community.zabbix.zabbix_agent"
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'roles/zabbix_agent/**'
|
|
- 'molecule/zabbix_agent/**'
|
|
- 'molecule/requirements.txt'
|
|
- '.github/workflows/agent.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'roles/zabbix_agent/**'
|
|
- 'molecule/zabbix_agent/**'
|
|
- 'molecule/requirements.txt'
|
|
- '.github/workflows/agent.yml'
|
|
jobs:
|
|
molecule:
|
|
runs-on: ubuntu-18.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
molecule_distro:
|
|
- container: centos8
|
|
image: geerlingguy/docker-rockylinux8-ansible:latest
|
|
- container: centos7
|
|
image: geerlingguy/docker-centos7-ansible:latest
|
|
- container: fedora32
|
|
image: geerlingguy/docker-fedora32-ansible:latest
|
|
- container: ubuntu2004
|
|
image: geerlingguy/docker-ubuntu2004-ansible
|
|
- container: pgsql-ubuntu1804
|
|
image: geerlingguy/docker-ubuntu1804-ansible
|
|
- container: debian10
|
|
image: geerlingguy/docker-debian10-ansible
|
|
- container: debian9
|
|
image: geerlingguy/docker-debian9-ansible
|
|
scenario_name:
|
|
- default
|
|
- autopsk
|
|
- agent2
|
|
- agent2autopsk
|
|
exclude: # zabbix-agent2 is not supported on debian8
|
|
- molecule_distro:
|
|
container: debian8
|
|
scenario_name: agent2
|
|
- molecule_distro:
|
|
container: debian8
|
|
scenario_name: agent2autopsk
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Set up Python 3.7
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r molecule/requirements.txt
|
|
|
|
- name: Build the collection
|
|
run: |
|
|
collection_file=$( basename $(ansible-galaxy collection build -f | awk -F" " '{print $NF}'))
|
|
echo "COLLECTION_FILE=$collection_file" >> $GITHUB_ENV
|
|
|
|
- name: Install the collection
|
|
run: ansible-galaxy collection install $COLLECTION_FILE
|
|
|
|
- name: Run role tests
|
|
working-directory: molecule/zabbix_agent_tests
|
|
run: >-
|
|
MY_MOLECULE_CONTAINER=${{ matrix.molecule_distro.container }}
|
|
MY_MOLECULE_IMAGE=${{ matrix.molecule_distro.image }}
|
|
MY_MOLECULE_DOCKER_COMMAND=${{ matrix.molecule_distro.command }}
|
|
molecule -c common/molecule.yml test -s ${{ matrix.scenario_name }}
|