name: "community.zabbix.zabbix_proxy" on: push: paths: - 'roles/zabbix_proxy/**' - 'molecule/zabbix_proxy/**' - 'molecule/requirements.txt' - '.github/workflows/proxy.yml' pull_request: paths: - 'roles/zabbix_proxy/**' - 'molecule/zabbix_proxy/**' - 'molecule/requirements.txt' - '.github/workflows/proxy.yml' jobs: molecule: runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: molecule_distro: - container: mysql-centos image: geerlingguy/docker-centos8-ansible:latest group: mysql - container: pgsql-centos image: geerlingguy/docker-centos8-ansible:latest group: postgresql - container: sqlite-centos image: geerlingguy/docker-centos8-ansible:latest group: sqlite3 - container: mysql-ubuntu image: geerlingguy/docker-ubuntu2004-ansible group: mysql - container: pgsql-ubuntu image: geerlingguy/docker-ubuntu2004-ansible group: postgresql command: /sbin/init - container: sqlite-ubuntu image: geerlingguy/docker-ubuntu2004-ansible group: sqlite3 command: /sbin/init - container: mysql-debian image: geerlingguy/docker-debian10-ansible group: mysql - container: pgsql-debian image: geerlingguy/docker-debian10-ansible group: postgresql - container: sqlite-debian image: geerlingguy/docker-debian10-ansible group: sqlite3 collection_role: - zabbix_proxy 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 }}