Debian Codegraph @

ansible_collections/community/zabbix/.github/workflows/agent.yml

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