| 1 |
--- |
| 2 |
name: "community.zabbix.zabbix_proxy" |
| 3 |
on: |
| 4 |
push: |
| 5 |
paths: |
| 6 |
- "roles/zabbix_proxy/**" |
| 7 |
- "molecule/zabbix_proxy/**" |
| 8 |
- "molecule/requirements.txt" |
| 9 |
- ".github/workflows/proxy.yml" |
| 10 |
- "roles/zabbix_repo/**" |
| 11 |
pull_request: |
| 12 |
paths: |
| 13 |
- "roles/zabbix_proxy/**" |
| 14 |
- "molecule/zabbix_proxy/**" |
| 15 |
- "molecule/requirements.txt" |
| 16 |
- ".github/workflows/proxy.yml" |
| 17 |
- "roles/zabbix_repo/**" |
| 18 |
jobs: |
| 19 |
base: |
| 20 |
runs-on: ubuntu-22.04 |
| 21 |
strategy: |
| 22 |
fail-fast: false |
| 23 |
matrix: |
| 24 |
container: |
| 25 |
- image: rockylinux10 |
| 26 |
- image: rockylinux9 |
| 27 |
- image: rockylinux8 |
| 28 |
ansible_core: ansible-core<2.17 |
| 29 |
- image: ubuntu2404 |
| 30 |
- image: ubuntu2204 |
| 31 |
- image: debian12 |
| 32 |
- image: debian11 |
| 33 |
- image: opensuseleap15 |
| 34 |
ansible_core: ansible-core<2.17 |
| 35 |
collection_role: |
| 36 |
- zabbix_proxy |
| 37 |
database: |
| 38 |
- mysql |
| 39 |
- pgsql |
| 40 |
- sqlite3 |
| 41 |
version: |
| 42 |
- v74 |
| 43 |
- v72 |
| 44 |
- v70 |
| 45 |
- v60 |
| 46 |
exclude: |
| 47 |
- container: |
| 48 |
image: rockylinux10 |
| 49 |
version: v72 |
| 50 |
- container: |
| 51 |
image: rockylinux10 |
| 52 |
version: v70 |
| 53 |
- container: |
| 54 |
image: rockylinux10 |
| 55 |
version: v60 |
| 56 |
steps: |
| 57 |
- name: Check out code |
| 58 |
uses: actions/checkout@v6 |
| 59 |
|
| 60 |
- name: Set up Python 3.11 |
| 61 |
uses: actions/setup-python@v6 |
| 62 |
with: |
| 63 |
python-version: 3.11 |
| 64 |
|
| 65 |
- name: Install latest pip |
| 66 |
run: python -m pip install --upgrade pip |
| 67 |
|
| 68 |
- name: Install specific version ansible-core |
| 69 |
if: matrix.container.ansible_core != null |
| 70 |
run: pip install "${{ matrix.container.ansible_core }}" |
| 71 |
|
| 72 |
- name: Install dependencies |
| 73 |
run: pip install -r molecule/requirements.txt |
| 74 |
|
| 75 |
- name: Build the collection |
| 76 |
run: | |
| 77 |
# Pin versions to speed up CI |
| 78 |
sed -i 's/ansible\.windows:\s*"\*"/ansible.windows: "2.8.0"/' galaxy.yml |
| 79 |
sed -i 's/ansible\.netcommon:\s*"\*"/ansible.netcommon: "7.2.0"/' galaxy.yml |
| 80 |
sed -i 's/ansible\.posix:\s*"\*"/ansible.posix: "2.0.0"/' galaxy.yml |
| 81 |
sed -i 's/community\.general:\s*"\*"/community.general: "10.5.0"/' galaxy.yml |
| 82 |
sed -i 's/community\.mysql:\s*"\*"/community.mysql: "3.13.0"/' galaxy.yml |
| 83 |
sed -i 's/community\.postgresql:\s*"\*"/community.postgresql: "3.12.0"/' galaxy.yml |
| 84 |
|
| 85 |
collection_file=$( basename $(ansible-galaxy collection build -f | awk -F" " '{print $NF}')) |
| 86 |
echo "COLLECTION_FILE=$collection_file" >> $GITHUB_ENV |
| 87 |
|
| 88 |
- name: Install the collection |
| 89 |
run: ansible-galaxy collection install -vvvv $COLLECTION_FILE |
| 90 |
|
| 91 |
- name: Run role tests |
| 92 |
run: >- |
| 93 |
MY_MOLECULE_CONTAINER=${{ matrix.container.image }} |
| 94 |
MY_MOLECULE_IMAGE=${{ matrix.container.image }} |
| 95 |
MY_MOLECULE_VERSION=${{ matrix.version }} |
| 96 |
MY_MOLECULE_DATABASE=${{ matrix.database }} |
| 97 |
MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }} |
| 98 |
molecule test -s ${{ matrix.collection_role }} |
| 99 |
|
| 100 |
psk: |
| 101 |
runs-on: ubuntu-22.04 |
| 102 |
strategy: |
| 103 |
fail-fast: false |
| 104 |
matrix: |
| 105 |
container: |
| 106 |
- image: rockylinux10 |
| 107 |
- image: rockylinux9 |
| 108 |
- image: rockylinux8 |
| 109 |
ansible_core: ansible-core<2.17 |
| 110 |
- image: ubuntu2404 |
| 111 |
- image: ubuntu2204 |
| 112 |
- image: debian12 |
| 113 |
- image: debian11 |
| 114 |
- image: opensuseleap15 |
| 115 |
ansible_core: ansible-core<2.17 |
| 116 |
collection_role: |
| 117 |
- zabbix_proxy_psk |
| 118 |
- zabbix_proxy_psk_active |
| 119 |
database: |
| 120 |
- mysql |
| 121 |
- pgsql |
| 122 |
- sqlite3 |
| 123 |
version: |
| 124 |
- v74 |
| 125 |
- v72 |
| 126 |
- v70 |
| 127 |
- v60 |
| 128 |
exclude: |
| 129 |
- container: |
| 130 |
image: rockylinux10 |
| 131 |
version: v72 |
| 132 |
- container: |
| 133 |
image: rockylinux10 |
| 134 |
version: v70 |
| 135 |
- container: |
| 136 |
image: rockylinux10 |
| 137 |
version: v60 |
| 138 |
steps: |
| 139 |
- name: Check out code |
| 140 |
uses: actions/checkout@v6 |
| 141 |
|
| 142 |
- name: Set up Python 3.11 |
| 143 |
uses: actions/setup-python@v6 |
| 144 |
with: |
| 145 |
python-version: 3.11 |
| 146 |
|
| 147 |
- name: Install latest pip |
| 148 |
run: python -m pip install --upgrade pip |
| 149 |
|
| 150 |
- name: Install specific version ansible-core |
| 151 |
if: matrix.container.ansible_core != null |
| 152 |
run: pip install "${{ matrix.container.ansible_core }}" |
| 153 |
|
| 154 |
- name: Install dependencies |
| 155 |
run: pip install -r molecule/requirements.txt |
| 156 |
|
| 157 |
- name: Build the collection |
| 158 |
run: | |
| 159 |
# Pin versions to speed up CI |
| 160 |
sed -i 's/ansible\.windows:\s*"\*"/ansible.windows: "2.8.0"/' galaxy.yml |
| 161 |
sed -i 's/ansible\.netcommon:\s*"\*"/ansible.netcommon: "7.2.0"/' galaxy.yml |
| 162 |
sed -i 's/ansible\.posix:\s*"\*"/ansible.posix: "2.0.0"/' galaxy.yml |
| 163 |
sed -i 's/community\.general:\s*"\*"/community.general: "10.5.0"/' galaxy.yml |
| 164 |
sed -i 's/community\.mysql:\s*"\*"/community.mysql: "3.13.0"/' galaxy.yml |
| 165 |
sed -i 's/community\.postgresql:\s*"\*"/community.postgresql: "3.12.0"/' galaxy.yml |
| 166 |
|
| 167 |
collection_file=$( basename $(ansible-galaxy collection build -f | awk -F" " '{print $NF}')) |
| 168 |
echo "COLLECTION_FILE=$collection_file" >> $GITHUB_ENV |
| 169 |
|
| 170 |
- name: Install the collection |
| 171 |
run: ansible-galaxy collection install -vvvv $COLLECTION_FILE |
| 172 |
|
| 173 |
- name: Run role tests |
| 174 |
run: >- |
| 175 |
MY_MOLECULE_CONTAINER=${{ matrix.container.image }} |
| 176 |
MY_MOLECULE_IMAGE=${{ matrix.container.image }} |
| 177 |
MY_MOLECULE_VERSION=${{ matrix.version }} |
| 178 |
MY_MOLECULE_DATABASE=${{ matrix.database }} |
| 179 |
MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }} |
| 180 |
molecule test -s ${{ matrix.collection_role }} |