15
15
16
16
jobs :
17
17
lint :
18
- runs-on : ubuntu-20.04
18
+ runs-on : ubuntu-latest
19
19
steps :
20
20
- name : checkout
21
21
uses : actions/checkout@v4
22
22
- name : ansible-lint
23
23
uses : ansible-community/ansible-lint-action@main
24
24
25
- python-3-9 :
25
+ molecule :
26
26
needs :
27
27
- lint
28
- runs-on : ubuntu-20.04
29
- container :
30
- image : python:3.9
28
+ runs-on : ubuntu-latest
31
29
strategy :
32
30
fail-fast : false
33
31
matrix :
34
- config :
32
+ distro :
35
33
- image : " alpine"
36
34
tag : " latest"
37
35
- image : " amazonlinux"
@@ -57,104 +55,46 @@ jobs:
57
55
steps :
58
56
- name : checkout
59
57
uses : actions/checkout@v4
58
+ with :
59
+ path : ansible-role-bootstrap
60
60
61
- - name : molecule
61
+ - name : Set up Python
62
+ uses : actions/setup-python@v5
63
+ with :
64
+ python-version : " 3.13"
65
+
66
+ - name : Configure Docker for systemd
62
67
run : |
63
- apt-get update -qq
64
- apt-get -y -qq install yamllint docker.io
65
- pip install --no-cache-dir tox
66
- if [ -f tox.ini ] ; then tox ; fi
67
- if [ ! -f tox.ini ] ; then pip install -r requirements.yml ; pip install ansible-lint ansible-core ; molecule test ; fi
68
- env :
69
- image : ${{ matrix.config.image }}
70
- tag : ${{ matrix.config.tag }}
71
- python-3-10 :
72
- needs :
73
- - lint
74
- runs-on : ubuntu-20.04
75
- container :
76
- image : python:3.10
77
- strategy :
78
- fail-fast : false
79
- matrix :
80
- config :
81
- - image : " alpine"
82
- tag : " latest"
83
- - image : " amazonlinux"
84
- tag : " latest"
85
- - image : " enterpriselinux"
86
- tag : " latest"
87
- - image : " debian"
88
- tag : " latest"
89
- - image : " debian"
90
- tag : " bullseye"
91
- - image : " fedora"
92
- tag : " 40"
93
- - image : " fedora"
94
- tag : " latest"
95
- - image : " fedora"
96
- tag : " rawhide"
97
- - image : " ubuntu"
98
- tag : " latest"
99
- - image : " ubuntu"
100
- tag : " jammy"
101
- - image : " ubuntu"
102
- tag : " focal"
103
- steps :
104
- - name : checkout
105
- uses : actions/checkout@v4
68
+ sudo mkdir -p /etc/docker
69
+ echo '{
70
+ "features": {
71
+ "buildkit": true
72
+ },
73
+ "exec-opts": ["native.cgroupdriver=systemd"]
74
+ }' | sudo tee /etc/docker/daemon.json
75
+ sudo systemctl restart docker || true
106
76
107
- - name : molecule
77
+ - name : Install Docker
78
+ uses : docker/setup-buildx-action@v3
79
+
80
+ - name : Install dependencies
108
81
run : |
109
- apt-get update -qq
110
- apt-get -y -qq install yamllint docker.io
111
- pip install --no-cache-dir tox
112
- if [ -f tox.ini ] ; then tox ; fi
113
- if [ ! -f tox.ini ] ; then pip install -r requirements.yml ; pip install ansible-lint ansible-core ; molecule test ; fi
114
- env :
115
- image : ${{ matrix.config.image }}
116
- tag : ${{ matrix.config.tag }}
117
- python-3-13 :
118
- needs :
119
- - lint
120
- runs-on : ubuntu-20.04
121
- container :
122
- image : python:3.13
123
- strategy :
124
- fail-fast : false
125
- matrix :
126
- config :
127
- - image : " alpine"
128
- tag : " latest"
129
- - image : " enterpriselinux"
130
- tag : " latest"
131
- - image : " debian"
132
- tag : " latest"
133
- - image : " debian"
134
- tag : " bullseye"
135
- - image : " fedora"
136
- tag : " 40"
137
- - image : " fedora"
138
- tag : " latest"
139
- - image : " fedora"
140
- tag : " rawhide"
141
- - image : " ubuntu"
142
- tag : " latest"
143
- - image : " ubuntu"
144
- tag : " jammy"
145
- - image : " ubuntu"
146
- tag : " focal"
147
- steps :
148
- - name : checkout
149
- uses : actions/checkout@v4
82
+ python -m pip install --upgrade pip
83
+ pip install ansible-lint molecule molecule-plugins[docker] ansible-core
84
+ if [ -f ansible-role-bootstrap/requirements.txt ]; then pip install -r ansible-role-bootstrap/requirements.txt; fi
85
+ if [ -f ansible-role-bootstrap/requirements.yml ]; then ansible-galaxy install -r ansible-role-bootstrap/requirements.yml; fi
86
+
87
+ # Create proper role directory structure for molecule
88
+ mkdir -p ~/.ansible/roles
89
+ ln -s ${GITHUB_WORKSPACE}/ansible-role-bootstrap ~/.ansible/roles/robertdebock.bootstrap
150
90
151
- - name : molecule
91
+ - name : Test with molecule
152
92
run : |
153
- apt-get update -qq
154
- apt-get -y -qq install yamllint docker.io
155
- pip install --no-cache-dir tox
156
- if [ -f tox.ini ] ; then tox ; fi
157
- if [ ! -f tox.ini ] ; then pip install -r requirements.yml ; pip install ansible-lint ansible-core ; molecule test ; fi
93
+ cd ansible-role-bootstrap
94
+ molecule test
158
95
env :
159
- image : ${{ matrix.config.image }}
160
- tag : ${{ matrix.config.tag }}
96
+ PY_COLORS : 1
97
+ ANSIBLE_FORCE_COLOR : 1
98
+ ANSIBLE_ROLES_PATH : ~/.ansible/roles:${GITHUB_WORKSPACE}/ansible-role-bootstrap
99
+ image : ${{ matrix.distro.image }}
100
+ tag : ${{ matrix.distro.tag }}
0 commit comments