Skip to content

Commit 06e0222

Browse files
Merge pull request #66 from MonolithProjects/develop
Better automated tests
2 parents ec2d44c + 7ed3caf commit 06e0222

33 files changed

+312
-398
lines changed

.github/workflows/galaxy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
release:
11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212
steps:
1313
- name: galaxy
1414
uses: robertdebock/[email protected]

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
types: [opened, synchronize, reopened]
1212
jobs:
1313
lint:
14-
runs-on: ubuntu-18.04
14+
runs-on: ubuntu-20.04
1515
strategy:
1616
fail-fast: true
1717
steps:
@@ -20,6 +20,6 @@ jobs:
2020
with:
2121
path: "${{ github.repository }}"
2222
- name: Molecule for Ansible - lint
23-
uses: MonolithProjects/[email protected].0
23+
uses: MonolithProjects/[email protected].1
2424
with:
2525
molecule_command: lint

.github/workflows/main.yml

+28-8
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,61 @@ name: molecule test
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- main
77
types: [opened, synchronize, reopened]
88
schedule:
99
- cron: '0 6 * * 0'
1010
jobs:
1111
repo:
1212
name: Test Repo Runner
13-
runs-on: ubuntu-18.04
13+
runs-on: ubuntu-20.04
1414
strategy:
15-
fail-fast: true
15+
fail-fast: false
16+
matrix:
17+
config:
18+
- os: "centos7"
19+
tag: "latest"
20+
- os: "centos8"
21+
tag: "latest"
22+
- os: "debian9"
23+
tag: "latest"
24+
- os: "debian10"
25+
tag: "latest"
26+
- os: "fedora33"
27+
tag: "latest"
28+
- os: "ubuntu18"
29+
tag: "latest"
30+
- os: "ubuntu20"
31+
tag: "latest"
1632
steps:
1733
- name: checkout
1834
uses: actions/checkout@v2
1935
with:
2036
path: "${{ github.repository }}"
2137
- name: Molecule for Ansible - GHR Repository
22-
uses: MonolithProjects/[email protected].0
38+
uses: MonolithProjects/[email protected].1
2339
env:
2440
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
2541
with:
42+
os: ${{ matrix.config.os }}
43+
tag: ${{ matrix.config.tag }}
2644
molecule_command: test
45+
scenario: repo
46+
2747
org:
2848
name: Test Org Runner
29-
runs-on: ubuntu-18.04
49+
runs-on: ubuntu-20.04
3050
strategy:
31-
fail-fast: true
51+
fail-fast: false
3252
steps:
3353
- name: checkout
3454
uses: actions/checkout@v2
3555
with:
3656
path: "${{ github.repository }}"
3757
- name: Molecule for Ansible - GHR Organization
38-
uses: MonolithProjects/[email protected].0
58+
uses: MonolithProjects/[email protected].1
3959
env:
4060
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
4161
with:
4262
molecule_command: test
43-
scenario: organization
63+
scenario: org

CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ cd ansible-github_actions_runner
3131
molecule test
3232
```
3333

34+
> You will need to edit the files in `molecule/default` directory (please do not commit those changes)
35+
3436
## 5. Create a pull request
3537

3638
Please create a pull request into the `develop` branch. Here is [how to do it](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork).
3739

38-
3940
Please consider to [sponsor](https://github.com/sponsors/monolithprojects) me :-)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Personal Access Token for GitHub account can be created [here](https://github.co
3232

3333
* ARM, ARM64 (dependencies installation is not covered by this role)
3434
* AMD64, x86_64
35-
## Weekly tested on:
35+
## Tested on:
3636

3737
* CentOS/RHEL 7,8
3838
* Debian 9,10
@@ -82,7 +82,7 @@ runner_org: no
8282
# Name to assign to this runner in GitHub (System hostname as default)
8383
runner_name: "{{ ansible_hostname }}"
8484

85-
# Labels to apply to the runner
85+
# Labels to apply to the runner. For examle "'label1','label2'"
8686
runner_labels: "''"
8787

8888
# Custom service name when usign Github Enterprise server

defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runner_org: no
3535
# Name to assign to this runner in GitHub (System hostname as default)
3636
runner_name: "{{ ansible_hostname }}"
3737

38-
# Labels to apply to the runner
38+
# Labels to apply to the runner. For examle "'label1','label2'"
3939
runner_labels: "''"
4040

4141
# Custom service name when usign Github Enterprise server

handlers/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# handlers file for ansible-github_actions_runner
2+
# handlers file for ansible-github_actions_runner (currently not used)
33
- name: Restart runner service
44
service:
55
name: "{{ runner_service }}"

molecule/default/Dockerfile.j2

-31
This file was deleted.

molecule/default/INSTALL.rst

-22
This file was deleted.

molecule/default/cleanup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
vars:
77
- runner_user: ansible
88
- github_repo: ansible-github_actions_runner-testrepo
9-
- github_account: monolithprojects
9+
- github_account: monolithprojects-testorg
1010
- runner_state: absent
1111
roles:
1212
- ansible-github_actions_runner

molecule/default/converge.yml

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
11
---
2-
- name: Install
2+
- name: Dev test playbook
33
user: ansible
44
hosts: all
55
gather_facts: yes
66
become: yes
77
vars:
88
- runner_user: ansible
99
- github_repo: ansible-github_actions_runner-testrepo
10-
- github_account: monolithprojects
11-
- runner_version: "latest"
12-
- reinstall_runner: yes
13-
roles:
14-
- robertdebock.epel
15-
- ansible-github_actions_runner
16-
17-
- name: Idempotence test
18-
user: ansible
19-
hosts: all
20-
become: yes
21-
gather_facts: yes
22-
vars:
23-
- runner_user: ansible
24-
- github_repo: ansible-github_actions_runner-testrepo
25-
- github_account: monolithprojects
10+
- github_account: monolithprojects-testorg
2611
- runner_version: "latest"
12+
- runner_labels: "'test1','test2'"
2713
roles:
2814
- robertdebock.epel
2915
- ansible-github_actions_runner

molecule/default/molecule.yml

+16-100
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,20 @@
11
---
2-
driver:
3-
name: docker
2+
provisioner:
3+
name: ansible
4+
playbooks:
5+
converge: converge.yml
6+
cleanup: cleanup.yml
7+
verify: verify.yml
8+
dependency:
9+
name: galaxy
410
lint: |
511
yamllint .
6-
ansible-lint
12+
ansible-lint .
13+
driver:
14+
name: docker
715
platforms:
8-
- name: CentOS7
9-
image: monolithprojects/systemd-centos7:latest
10-
command: /sbin/init
11-
tmpfs:
12-
- /run
13-
- /tmp
14-
volumes:
15-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
16-
privileged: yes
17-
pre_build_image: yes
18-
- name: CentOS8
19-
image: monolithprojects/systemd-centos8:latest
20-
command: /sbin/init
21-
tmpfs:
22-
- /run
23-
- /tmp
24-
volumes:
25-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
26-
privileged: yes
27-
pre_build_image: yes
28-
- name: Fedora32
29-
image: monolithprojects/systemd-fedora32:latest
30-
command: /sbin/init
31-
tmpfs:
32-
- /run
33-
- /tmp
34-
volumes:
35-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
36-
privileged: yes
37-
pre_build_image: yes
38-
- name: Fedora33
39-
image: monolithprojects/systemd-fedora33:latest
16+
- name: "${os:-ubuntu16}-${tag:-latest}"
17+
image: "${namespace:-monolithprojects}/systemd-${os:-ubuntu16}:${tag:-latest}"
4018
command: /sbin/init
4119
tmpfs:
4220
- /run
@@ -45,70 +23,8 @@ platforms:
4523
- /sys/fs/cgroup:/sys/fs/cgroup:ro
4624
privileged: yes
4725
pre_build_image: yes
48-
- name: Ubuntu16
49-
image: monolithprojects/systemd-ubuntu16:latest
50-
command: /sbin/init
51-
tmpfs:
52-
- /run
53-
- /tmp
54-
volumes:
55-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
56-
privileged: yes
57-
pre_build_image: yes
58-
- name: Ubuntu18
59-
image: monolithprojects/systemd-ubuntu18:latest
60-
command: /sbin/init
61-
tmpfs:
62-
- /run
63-
- /tmp
64-
volumes:
65-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
66-
privileged: yes
67-
pre_build_image: yes
68-
- name: Ubuntu20
69-
image: monolithprojects/systemd-ubuntu20:latest
70-
command: /sbin/init
71-
tmpfs:
72-
- /run
73-
- /tmp
74-
volumes:
75-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
76-
privileged: yes
77-
pre_build_image: yes
78-
- name: Debian9
79-
image: monolithprojects/systemd-debian9:latest
80-
command: /sbin/init
81-
tmpfs:
82-
- /run
83-
- /tmp
84-
volumes:
85-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
86-
privileged: yes
87-
pre_build_image: yes
88-
- name: Debian10
89-
image: monolithprojects/systemd-debian10:latest
90-
command: /sbin/init
91-
tmpfs:
92-
- /run
93-
- /tmp
94-
volumes:
95-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
96-
privileged: yes
97-
pre_build_image: yes
98-
provisioner:
99-
name: ansible
100-
playbooks:
101-
converge: converge.yml
102-
cleanup: cleanup.yml
103-
log: false
10426
verifier:
105-
name: testinfra
106-
directory: tests
107-
dependency:
108-
name: galaxy
109-
options:
110-
ignore-certs: True
111-
ignore-errors: True
27+
name: ansible
11228
scenario:
11329
name: default
11430
test_sequence:
@@ -117,8 +33,8 @@ scenario:
11733
- destroy
11834
- syntax
11935
- create
120-
# - prepare
12136
- converge
122-
# - idempotence
37+
- idempotence
38+
- verify
12339
- cleanup
12440
- destroy

molecule/default/requirements.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
- role: robertdebock.epel
3-
version: 2.5.4
3+
version: 3.0.1

0 commit comments

Comments
 (0)