Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bec-galaxy/setup-molecule
Set up your GitHub Actions workflow with the Ansible testing framework Molecule.
https://github.com/bec-galaxy/setup-molecule
ansible docker github-action molecule
Last synced: 4 days ago
JSON representation
Set up your GitHub Actions workflow with the Ansible testing framework Molecule.
- Host: GitHub
- URL: https://github.com/bec-galaxy/setup-molecule
- Owner: bec-galaxy
- License: mit
- Created: 2023-04-28T07:47:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-10T20:00:52.000Z (over 1 year ago)
- Last Synced: 2024-10-17T02:28:28.760Z (20 days ago)
- Topics: ansible, docker, github-action, molecule
- Homepage:
- Size: 115 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# setup-molecule
[![Test](https://github.com/bec-galaxy/setup-molecule/actions/workflows/test.yml/badge.svg)](https://github.com/bec-galaxy/setup-molecule/actions/workflows/test.yml)
This action provides the following functionality for GitHub Actions users:
- Installing Python.
- Installing the latest version of Molecule with Docker.> This action is a rolling release, it will install the latest dependencies on each run. Use [the official Ansible action](https://github.com/marketplace/actions/ansible-lint) for more stability. See [Ansible Creator Execution Environment](https://github.com/ansible/creator-ee) for additional information.
## Basic usage
See [action.yml](action.yml)
**Molecule**
```yaml
steps:
- name: Checkout the codebase
uses: actions/checkout@v3- name: Setup Molecule
uses: bec-galaxy/setup-molecule@{Version}- name: Run Molecule tests
run: molecule test
```**Lint and Molecule**
```yaml
---
name: Molecule"on":
pull_request:env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout the codebase
uses: actions/checkout@v3- name: Setup Lint
uses: bec-galaxy/setup-lint@{Version}- name: Run Lint tests
run: ansible-lintmolecule:
name: Molecule
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout the codebase
uses: actions/checkout@v3- name: Setup Molecule
uses: bec-galaxy/setup-molecule@{Version}- name: Run Molecule tests
run: molecule test
```Built-in Lint support has been [removed from Molecule](https://github.com/ansible-community/molecule/discussions/3825#discussioncomment-4908366).
> Environment variables `PY_COLORS` and `ANSIBLE_FORCE_COLOR` are optional and only activate the color output in the pipline.
## Packages
The following python packages are installed in this action:
- [ansible](https://pypi.org/project/ansible/)
- [molecule](https://pypi.org/project/molecule/)
- [molecule-plugins](https://pypi.org/project/molecule-plugins/)
- [docker](https://pypi.org/project/docker/)> Package `molecule-plugins` is a breaking change and is required since `molecule` version 5.0.0.
## Molecule file
A Molecule sample file for this action.
```yaml
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: ubuntu-20.04
image: ubuntu:20.04
- name: ubuntu-22.04
image: ubuntu:22.04
provisioner:
name: ansible
inventory:
group_vars:
all:
ansible_user: root
scenario:
name: default
```## Licence
This project is licensed under MIT - See the [LICENSE](LICENSE) file for more information.
---
↑ [Back to top](#)