Skip to content

Commit b5eb5ea

Browse files
docs: update contributing
1 parent 54d61fd commit b5eb5ea

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

.github/CONTRIBUTING.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,51 @@ Install [Pre-commit](https://pre-commit.com/#install) software
2323

2424
Do the changes in your own GitHub namespace.
2525

26-
## 5. Test the changes
26+
## 5. Test the changes with Molecule
2727

28-
**Note:** I will test the role again, so you don't need to do that if you don't want to.
28+
[Molecule](https://molecule.readthedocs.io/) is a testing framework for Ansible that we use to test the `monolithprojects.github_actions_runner` role.
2929

30-
Install [molecule](https://molecule.readthedocs.io/en/stable/) and run the test:
30+
### Prerequisites
31+
32+
- Python
33+
- Docker
34+
- Ansible
35+
- Molecule
36+
37+
### Installation
38+
39+
1. Install Python, Docker, and Ansible if you haven't already.
40+
2. Install Molecule and its Docker driver with pip:
41+
42+
```bash
43+
pip install molecule[docker]
44+
```
45+
46+
### Running Tests
47+
48+
1. Navigate to the role's directory:
49+
50+
```bash
51+
cd path/to/monolithprojects.github_actions_runner
52+
```
53+
54+
2. Set Environment variables
55+
56+
```bash
57+
export PERSONAL_ACCESS_TOKEN=your_github_pat # Your Personal Access Token to Github
58+
export GITHUB_ACCOUNT=your_account # Your Github Account
59+
export GITHUB_ACCOUNT=your_repository # Github Repository where you want to setup the Runner
60+
```
61+
62+
3. Run Molecule:
3163

3264
```bash
33-
pip install molecule molecule-docker ansible-lint docker
34-
cd ansible-github_actions_runner
3565
molecule test
3666
```
3767

38-
> You will need to edit the files in `molecule/default` directory (please do not commit those changes)
68+
This will run the molecule test, create a Docker container, run the role against it, run any associated `default` tests (see [molecule/default](../molecule/default) directory), and then destroy the container.
69+
70+
For more information on using Molecule, see the [Molecule documentation](https://molecule.readthedocs.io/).
3971

4072
## 6. Create a pull request
4173

0 commit comments

Comments
 (0)