@@ -126,3 +126,52 @@ jobs:
126126 "python-version": "3.9"
127127 }
128128 ]
129+ molecule :
130+ runs-on : ubuntu-latest
131+ strategy :
132+ matrix :
133+ python_version : ["3.11"]
134+ ansible_version : ["2.14", "2.15"]
135+ molecule_test :
136+ - stage_eap
137+ steps :
138+ - name : Check out code
139+ uses : actions/checkout@v3
140+ with :
141+ path : ansible_collections/middleware_automation/common
142+
143+ - name : Set up Python ${{ matrix.python_version }}
144+ uses : actions/setup-python@v4
145+ with :
146+ python-version : ${{ matrix.python_version }}
147+ cache : ' pip'
148+
149+ - name : Create default collection path
150+ run : |
151+ mkdir -p /home/runner/.ansible/
152+ ln -s /home/runner/work/common/common /home/runner/.ansible/collections
153+
154+ - name : Install ansible and molecule
155+ run : |
156+ python -m pip install --upgrade pip
157+ pip install 'molecule>=4.0.4' 'molecule-plugins[docker]>=23.0.0' ansible-core==${{ matrix.ansible_version }}
158+ if [ -f ansible_collections/middleware_automation/common/requirements.txt ]; then
159+ pip install -r ansible_collections/middleware_automation/common/requirements.txt
160+ fi
161+ if [ -f ansible_collections/middleware_automation/common/requirements.yml ]; then
162+ ansible-galaxy collection install -r ansible_collections/middleware_automation/common/requirements.yml -p /home/runner/.ansible/collections --force-with-deps
163+ fi
164+ if [ -f ansible_collections/middleware_automation/common/molecule/requirements.yml ]; then
165+ ansible-galaxy collection install -r ansible_collections/middleware_automation/common/molecule/requirements.yml -p /home/runner/.ansible/collections
166+ fi
167+
168+ - name : Run molecule test
169+ run : molecule test -s ${{ matrix.molecule_test }}
170+ working-directory : ./ansible_collections/middleware_automation/common
171+ env :
172+ PY_COLORS : ' 1'
173+ ANSIBLE_FORCE_COLOR : ' 1'
174+ PROD_JBOSSNETWORK_API_CLIENTID : ${{ secrets.PROD_JBOSSNETWORK_API_CLIENTID }}
175+ PROD_JBOSSNETWORK_API_SECRET : ${{ secrets.PROD_JBOSSNETWORK_API_SECRET }}
176+ STAGE_JBOSSNETWORK_API_CLIENTID : ${{ secrets.STAGE_JBOSSNETWORK_API_CLIENTID }}
177+ STAGE_JBOSSNETWORK_API_SECRET : ${{ secrets.STAGE_JBOSSNETWORK_API_SECRET }}
0 commit comments