Debian Codegraph @

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

raw
1 ---
2 name: "community.zabbix.zabbix_javagateway"
3 on:
4 push:
5 paths:
6 - "roles/zabbix_javagateway/**"
7 - "molecule/zabbix_javagateway/**"
8 - "molecule/requirements.txt"
9 - ".github/workflows/javagateway.yml"
10 - "roles/zabbix_repo/**"
11 pull_request:
12 paths:
13 - "roles/zabbix_javagateway/**"
14 - "molecule/zabbix_javagateway/**"
15 - "molecule/requirements.txt"
16 - ".github/workflows/javagateway.yml"
17 - "roles/zabbix_repo/**"
18 jobs:
19 molecule:
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 collection_role:
41 - zabbix_javagateway
42 exclude:
43 - container:
44 image: rockylinux10
45 version: v72
46 - container:
47 image: rockylinux10
48 version: v70
49 - container:
50 image: rockylinux10
51 version: v60
52 steps:
53 - name: Check out code
54 uses: actions/checkout@v6
55
56 - name: Set up Python 3.11
57 uses: actions/setup-python@v6
58 with:
59 python-version: 3.11
60
61 - name: Install latest pip
62 run: python -m pip install --upgrade pip
63
64 - name: Install specific version ansible-core
65 if: matrix.container.ansible_core != null
66 run: pip install "${{ matrix.container.ansible_core }}"
67
68 - name: Install dependencies
69 run: pip install -r molecule/requirements.txt
70
71 - name: Build the collection
72 run: |
73 # Pin versions to speed up CI
74 sed -i 's/ansible\.windows:\s*"\*"/ansible.windows: "2.8.0"/' galaxy.yml
75 sed -i 's/ansible\.netcommon:\s*"\*"/ansible.netcommon: "7.2.0"/' galaxy.yml
76 sed -i 's/ansible\.posix:\s*"\*"/ansible.posix: "2.0.0"/' galaxy.yml
77 sed -i 's/community\.general:\s*"\*"/community.general: "10.5.0"/' galaxy.yml
78 sed -i 's/community\.mysql:\s*"\*"/community.mysql: "3.13.0"/' galaxy.yml
79 sed -i 's/community\.postgresql:\s*"\*"/community.postgresql: "3.12.0"/' galaxy.yml
80
81 collection_file=$( basename $(ansible-galaxy collection build -f | awk -F" " '{print $NF}'))
82 echo "COLLECTION_FILE=$collection_file" >> $GITHUB_ENV
83
84 - name: Install the collection
85 run: ansible-galaxy collection install -vvvv $COLLECTION_FILE
86
87 - name: Run role tests
88 run: >-
89 MY_MOLECULE_CONTAINER=${{ matrix.container.image }}
90 MY_MOLECULE_IMAGE=${{ matrix.container.image }}
91 MY_MOLECULE_VERSION=${{ matrix.version }}
92 MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }}
93 molecule test -s ${{ matrix.collection_role }}