60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
---
|
|
name: "community.zabbix.zabbix_javagateway"
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'roles/zabbix_javagateway/**'
|
|
- 'molecule/zabbix_javagateway/**'
|
|
- 'molecule/requirements.txt'
|
|
- '.github/workflows/javagateway.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'roles/zabbix_javagateway/**'
|
|
- 'molecule/zabbix_javagateway/**'
|
|
- 'molecule/requirements.txt'
|
|
- '.github/workflows/javagateway.yml'
|
|
jobs:
|
|
molecule:
|
|
runs-on: ubuntu-18.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
molecule_distro:
|
|
- container: centos
|
|
image: geerlingguy/docker-centos8-ansible:latest
|
|
- container: ubuntu
|
|
image: geerlingguy/docker-ubuntu2004-ansible
|
|
- container: debian
|
|
image: geerlingguy/docker-debian10-ansible
|
|
collection_role:
|
|
- zabbix_javagateway
|
|
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 }}
|