--- name: "community.zabbix.zabbix_agent" on: push: paths: - "roles/zabbix_agent/**" - "molecule/zabbix_agent/**" - "molecule/requirements.txt" - ".github/workflows/agent.yml" - "roles/zabbix_repo/**" pull_request: paths: - "roles/zabbix_agent/**" - "molecule/zabbix_agent/**" - "molecule/requirements.txt" - ".github/workflows/agent.yml" - "roles/zabbix_repo/**" jobs: base: runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: container: - image: rockylinux10 - image: rockylinux9 - image: rockylinux8 ansible_core: ansible-core<2.17 - image: ubuntu2404 - image: ubuntu2204 - image: debian12 - image: debian11 - image: opensuseleap15 ansible_core: ansible-core<2.17 version: - v74 - v72 - v70 - v60 scenario_name: - default - agent2 exclude: - container: image: rockylinux10 version: v72 - container: image: rockylinux10 version: v70 - container: image: rockylinux10 version: v60 steps: - name: Check out code uses: actions/checkout@v6 - name: Set up Python 3.11 uses: actions/setup-python@v6 with: python-version: 3.11 - name: Install latest pip run: python -m pip install --upgrade pip - name: Install specific version ansible-core if: matrix.container.ansible_core != null run: pip install "${{ matrix.container.ansible_core }}" - name: Install dependencies run: pip install -r molecule/requirements.txt - name: Build the collection run: | # Pin versions to speed up CI sed -i 's/ansible\.windows:\s*"\*"/ansible.windows: "2.8.0"/' galaxy.yml sed -i 's/ansible\.netcommon:\s*"\*"/ansible.netcommon: "7.2.0"/' galaxy.yml sed -i 's/ansible\.posix:\s*"\*"/ansible.posix: "2.0.0"/' galaxy.yml sed -i 's/community\.general:\s*"\*"/community.general: "10.5.0"/' galaxy.yml sed -i 's/community\.mysql:\s*"\*"/community.mysql: "3.13.0"/' galaxy.yml sed -i 's/community\.postgresql:\s*"\*"/community.postgresql: "3.12.0"/' galaxy.yml 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 -vvvv $COLLECTION_FILE - name: Run role tests working-directory: molecule/zabbix_agent_tests run: >- MY_MOLECULE_CONTAINER=${{ matrix.container.image }} MY_MOLECULE_IMAGE=${{ matrix.container.image }} MY_MOLECULE_VERSION=${{ matrix.version }} MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }} molecule -c common/molecule.yml test -s ${{ matrix.scenario_name }} psk: runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: container: - image: rockylinux10 - image: rockylinux9 - image: rockylinux8 ansible_core: ansible-core<2.17 - image: ubuntu2404 - image: ubuntu2204 - image: debian12 - image: debian11 - image: opensuseleap15 ansible_core: ansible-core<2.17 version: - v74 - v72 - v70 - v60 scenario_name: - autopsk - agent2autopsk exclude: - container: image: rockylinux10 version: v72 - container: image: rockylinux10 version: v70 - container: image: rockylinux10 version: v60 steps: - name: Check out code uses: actions/checkout@v6 - name: Set up Python 3.11 uses: actions/setup-python@v6 with: python-version: 3.11 - name: Install latest pip run: python -m pip install --upgrade pip - name: Install specific version ansible-core if: matrix.container.ansible_core != null run: pip install "${{ matrix.container.ansible_core }}" - name: Install dependencies run: pip install -r molecule/requirements.txt - name: Build the collection run: | # Pin versions to speed up CI sed -i 's/ansible\.windows:\s*"\*"/ansible.windows: "2.8.0"/' galaxy.yml sed -i 's/ansible\.netcommon:\s*"\*"/ansible.netcommon: "7.2.0"/' galaxy.yml sed -i 's/ansible\.posix:\s*"\*"/ansible.posix: "2.0.0"/' galaxy.yml sed -i 's/community\.general:\s*"\*"/community.general: "10.5.0"/' galaxy.yml sed -i 's/community\.mysql:\s*"\*"/community.mysql: "3.13.0"/' galaxy.yml sed -i 's/community\.postgresql:\s*"\*"/community.postgresql: "3.12.0"/' galaxy.yml 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 -vvvv $COLLECTION_FILE - name: Run role tests working-directory: molecule/zabbix_agent_tests run: >- MY_MOLECULE_CONTAINER=${{ matrix.container.image }} MY_MOLECULE_IMAGE=${{ matrix.container.image }} MY_MOLECULE_VERSION=${{ matrix.version }} MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }} molecule -c common/molecule.yml test -s ${{ matrix.scenario_name }}