@@ -2,26 +2,30 @@ name: molecule test
2
2
3
3
on :
4
4
pull_request :
5
- types :
6
- - opened
7
- - reopened
8
- - synchronize
9
5
branches :
10
- - ' master'
6
+ - main
7
+ types : [opened, synchronize, reopened]
8
+ paths :
9
+ - ' defaults/**'
10
+ - ' handlers/**'
11
+ - ' molecule/**'
12
+ - ' tasks/**'
13
+ - ' templates/**'
14
+ - ' vars/**'
11
15
schedule :
12
- - cron : ' 0 6 * * 0'
16
+ - cron : ' 0 6 * * 0'
13
17
workflow_dispatch :
14
18
15
19
env :
16
- MOLECULE_DOCKER_VOLUMES : ro
17
- MOLECULE_DOCKER_CGROUPS_MODE : private
20
+ MOLECULE_DOCKER_VOLUMES : rw
21
+ MOLECULE_DOCKER_CGROUPS_MODE : host
18
22
19
23
jobs :
20
24
repo :
21
- name : Test Repo Runner
25
+ name : Test GHA Runner Role
22
26
environment :
23
27
name : test
24
- runs-on : ubuntu-20 .04
28
+ runs-on : ubuntu-22 .04
25
29
strategy :
26
30
fail-fast : false
27
31
max-parallel : 3
@@ -42,32 +46,67 @@ jobs:
42
46
uses : actions/checkout@v3
43
47
with :
44
48
path : " ${{ github.repository }}"
45
- - name : Molecule for Ansible - GHR Repository
46
- uses :
MonolithProjects/[email protected]
49
+
50
+ - name : Set up Python 3
51
+ uses : actions/setup-python@v4
52
+ with :
53
+ python-version : ' 3.x'
54
+
55
+ - name : Install test dependencies
56
+ run : pip3 install ansible docker molecule molecule-plugins[docker] "requests<2.29.2"
57
+
58
+ - name : Run Molecule test - repo
59
+ run : molecule test --scenario-name repo
60
+ working-directory : " ${{ github.repository }}"
47
61
env :
62
+ PY_COLORS : ' 1'
63
+ ANSIBLE_FORCE_COLOR : ' 1'
64
+ MOLECULE_IMAGE : ${{ matrix.config.os }}
65
+ MOLECULE_DOCKER_CGROUPS_MODE : ${{ matrix.config.cgroup_mode }}
66
+ MOLECULE_DOCKER_VOLUMES : ${{ matrix.config.volumes }}
48
67
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
49
- with :
50
- os : ${{ matrix.config.os }}
51
- tag : ${{ matrix.config.tag }}
52
- molecule_command : test
53
- scenario : repo
54
68
55
69
org :
56
70
name : Test Org Runner
57
71
environment :
58
72
name : test
59
- runs-on : ubuntu-20 .04
73
+ runs-on : ubuntu-22 .04
60
74
strategy :
61
75
fail-fast : false
76
+ max-parallel : 3
77
+ matrix :
78
+ config :
79
+ - os : " debian11"
80
+ tag : " latest"
81
+ - os : " fedora37"
82
+ tag : " latest"
83
+ - os : " ubuntu20"
84
+ tag : " latest"
85
+ - os : " ubuntu22"
86
+ tag : " latest"
87
+ - os : " rockylinux8"
88
+ tag : " latest"
62
89
steps :
63
90
- name : checkout
64
91
uses : actions/checkout@v3
65
92
with :
66
93
path : " ${{ github.repository }}"
67
- - name : Molecule for Ansible - GHR Organization
68
- uses :
MonolithProjects/[email protected]
94
+
95
+ - name : Set up Python 3
96
+ uses : actions/setup-python@v4
97
+ with :
98
+ python-version : ' 3.x'
99
+
100
+ - name : Install test dependencies
101
+ run : pip3 install ansible docker molecule molecule-plugins[docker] "requests<2.29.2"
102
+
103
+ - name : Run Molecule tests -
104
+ run : molecule test --scenario-name org
105
+ working-directory : " ${{ github.repository }}"
69
106
env :
107
+ PY_COLORS : ' 1'
108
+ ANSIBLE_FORCE_COLOR : ' 1'
109
+ MOLECULE_IMAGE : ${{ matrix.config.os }}
110
+ MOLECULE_DOCKER_CGROUPS_MODE : ${{ matrix.config.cgroup_mode }}
111
+ MOLECULE_DOCKER_VOLUMES : ${{ matrix.config.volumes }}
70
112
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
71
- with :
72
- molecule_command : test
73
- scenario : org
0 commit comments