73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
---
|
|
name: "community.zabbix.zabbix_server"
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'roles/zabbix_server/**'
|
|
- 'molecule/zabbix_server/**'
|
|
- 'molecule/requirements.txt'
|
|
- '.github/workflows/server.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'roles/zabbix_server/**'
|
|
- 'molecule/zabbix_server/**'
|
|
- 'molecule/requirements.txt'
|
|
- '.github/workflows/server.yml'
|
|
jobs:
|
|
molecule:
|
|
runs-on: ubuntu-18.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
molecule_distro:
|
|
- container: mysql-centos
|
|
image: geerlingguy/docker-rockylinux8-ansible:latest
|
|
group: mysql
|
|
- container: pgsql-centos
|
|
image: geerlingguy/docker-rockylinux8-ansible:latest
|
|
group: postgresql
|
|
- container: mysql-ubuntu
|
|
image: geerlingguy/docker-ubuntu2004-ansible
|
|
group: mysql
|
|
- container: pgsql-ubuntu
|
|
image: geerlingguy/docker-ubuntu2004-ansible
|
|
group: postgresql
|
|
command: /sbin/init
|
|
- container: mysql-debian
|
|
image: geerlingguy/docker-debian10-ansible
|
|
group: mysql
|
|
- container: pgsql-debian
|
|
image: geerlingguy/docker-debian10-ansible
|
|
group: postgresql
|
|
collection_role:
|
|
- zabbix_server
|
|
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
|
|
run: >-
|
|
MY_MOLECULE_CONTAINER=${{ matrix.molecule_distro.container }}
|
|
MY_MOLECULE_IMAGE=${{ matrix.molecule_distro.image }}
|
|
MY_MOLECULE_GROUP=${{ matrix.molecule_distro.group }}
|
|
MY_MOLECULE_DOCKER_COMMAND=${{ matrix.molecule_distro.command }}
|
|
molecule test -s ${{ matrix.collection_role }}
|