{"id":13531607,"url":"https://github.com/robertdebock/molecule-action","last_synced_at":"2025-02-24T23:44:52.440Z","repository":{"id":41284501,"uuid":"229093006","full_name":"robertdebock/molecule-action","owner":"robertdebock","description":"Test Ansible roles using Molecule","archived":false,"fork":false,"pushed_at":"2024-01-08T13:58:48.000Z","size":57,"stargazers_count":54,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-16T10:28:52.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://robertdebock.nl/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdebock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-19T16:16:12.000Z","updated_at":"2024-12-30T22:24:43.000Z","dependencies_parsed_at":"2024-01-08T15:34:26.532Z","dependency_job_id":null,"html_url":"https://github.com/robertdebock/molecule-action","commit_stats":{"total_commits":104,"total_committers":5,"mean_commits":20.8,"dds":"0.038461538461538436","last_synced_commit":"a71e455d3ce0925e285c32acc419efa048dd50e4"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fmolecule-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fmolecule-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fmolecule-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fmolecule-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdebock","download_url":"https://codeload.github.com/robertdebock/molecule-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240576486,"owners_count":19823293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:04.293Z","updated_at":"2025-02-24T23:44:52.132Z","avatar_url":"https://github.com/robertdebock.png","language":null,"funding_links":[],"categories":["Community Resources"],"sub_categories":["Static Analysis"],"readme":"# Molecule action\n\nA GitHub action to test your [Ansible](https://www.ansible.com/) role using [Molecule](https://molecule.readthedocs.io/).\n\n## Requirements\n\nThis action can work with Molecule scenarios that use the [`docker`](https://molecule.readthedocs.io/configuration) driver.\n\nThis action expects the following (default Ansible role) structure:\n```\n.\n├── defaults\n│   └── main.yml\n├── handlers\n│   └── main.yml\n├── meta\n│   └── main.yml\n├── molecule\n│   └── default\n│       ├── molecule.yml\n│       ├── playbook.yml\n│       └── prepare.yml\n├── requirements.yml\n├── tasks\n│   └── main.yml\n├── tox.ini # OPTIONAL\n└── vars\n    └── main.yml\n```\n\nIf you are missing the `molecule` directory, please have a look at this [skeleton role](https://github.com/robertdebock/ansible-role-skeleton) or one of the many examples listed on [my website](https://robertdebock.nl/).\n\nWhen `tox.ini` is found, [tox](https://tox.readthedocs.io/en/latest/) is used to test the role. Tox will install all dependecies found in `tox.ini` itself, meaning `tox.ini` determines the version of [molecule](https://molecule.readthedocs.io/en/latest/) that is used.\n\n## Inputs\n\n### `namespace`\n\nThe Docker Hub namespace where the image is in. Default `\"robertdebock\"`.\n\n### `image`\n\nThe image you want to run on. Default `\"fedora\"`.\n\n### `tag`\n\nThe tag of the container image to use. Default `\"latest\"`.\n\n### `options`\n\nThe [options to pass to `tox`](https://tox.readthedocs.io/en/latest/config.html#tox). For example `parallel`. Default `\"\"`. (empty)\n\n### `command`\n\nThe molecule command to use. For example `create`. Default `\"test\"`.\n\n### `scenario`\n\nThe molecule scenario to run. Default `\"default\"`\n\n## Example usage\n\nHere is a default configuration that tests your role on `namespace: robertdebock`, `image: fedora`, `tag: latest`.\n\n```yaml\n---\non:\n  - push\n\njobs:\n  build:\n    runs-on: ubuntu-20.04\n    steps:\n      - name: checkout\n        uses: actions/checkout@v3\n        with:\n          path: \"${{ github.repository }}\"\n      - name: molecule\n        uses: robertdebock/molecule-action@6.0.0\n```\n\n\u003e NOTE: the `checkout` action needs to place the file in `${{ github.repository }}` in order for Molecule to find your role.\n\nIf you want to test your role against multiple distributions, you can use this pattern:\n\n```yaml\n---\nname: CI\n\non:\n  - push\n\njobs:\n  lint:\n    runs-on: ubuntu-20.04\n    steps:\n      - name: checkout\n        uses: actions/checkout@v3\n        with:\n          path: \"${{ github.repository }}\"\n      - name: molecule\n        uses: robertdebock/molecule-action@6.0.0\n        with:\n          command: lint\n  test:\n    needs:\n      - lint\n    runs-on: ubuntu-20.04\n    strategy:\n      matrix:\n        image:\n          - alpine\n          - amazonlinux\n          - debian\n          - centos\n          - fedora\n          - opensuse\n          - ubuntu\n    steps:\n      - name: checkout\n        uses: actions/checkout@v3\n        with:\n          path: \"${{ github.repository }}\"\n      - name: molecule\n        uses: robertdebock/molecule-action@6.0.0\n        with:\n          image: \"${{ matrix.image }}\"\n          options: parallel\n          scenario: my_specific_scenario\n```\n\n## Debugging\n\nYou can enable Molecule debugging by using this pattern:\n\n```yaml\n# Stuff omitted.\n      - name: molecule\n        uses: robertdebock/molecule-action@6.0.0\n        with:\n          image: ${{ matrix.config.image }}\n          tag: ${{ matrix.config.tag }}\n          command: \"--debug test\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fmolecule-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdebock%2Fmolecule-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fmolecule-action/lists"}