View all files | ||||
A GitHub action to test your Ansible role using Molecule.
This action can work with Molecule scenarios that use the docker driver.
This action expects the following (default Ansible role) structure:
If you are missing the molecule directory, please have a look at this skeleton role or one of the many examples listed on my website.
When tox.ini is found, tox is used to test the role. Tox will install all dependecies found in tox.ini itself, meaning tox.ini determines the version of molecule that is used.
The Docker Hub namespace where the image is in. Default "robertdebock".
The image you want to run on. Default "fedora".
The tag of the container image to use. Default "latest".
The options to pass to tox. For example parallel. Default "". (empty)
The molecule command to use. For example create. Default "test".
The molecule scenario to run. Default "default"
Here is a default configuration that tests your role on namespace: robertdebock, image: fedora, tag: latest.
NOTE: the checkout action needs to place the file in ${{ github.repository }} in order for Molecule to find your role.
If you want to test your role against multiple distributions, you can use this pattern:
You can enable Molecule debugging by using this pattern: