-
-
Notifications
You must be signed in to change notification settings - Fork 67
191 lines (161 loc) · 5.51 KB
/
pull_request_target.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
---
name: Molecule Tests
on:
# Manual approval of environment is required
pull_request_target:
branches:
- main
paths-ignore:
- ".devcontainer/**"
- "README.md"
env:
# https://www.jeffgeerling.com/blog/2020/getting-colorized-output-molecule-and-ansible-on-github-actions-ci
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
jobs:
molecule:
name: "Test Distro"
strategy:
fail-fast: false
matrix:
include:
- image: ghcr.io/artis3n/docker-amazonlinux2023-ansible:latest
- image: geerlingguy/docker-rockylinux8-ansible:latest
- image: geerlingguy/docker-rockylinux9-ansible:latest
- image: ghcr.io/artis3n/docker-almalinux8-ansible:latest
- image: ghcr.io/artis3n/docker-rhel8-ansible:latest
- image: ghcr.io/artis3n/docker-oraclelinux8-ansible:latest
- image: geerlingguy/docker-ubuntu2204-ansible:latest
- image: geerlingguy/docker-ubuntu2004-ansible:latest
- image: geerlingguy/docker-ubuntu1804-ansible:latest
command: /lib/systemd/systemd
- image: cisagov/docker-debian12-ansible:latest
- image: geerlingguy/docker-debian11-ansible:latest
command: /lib/systemd/systemd
- image: geerlingguy/docker-debian10-ansible:latest
command: /lib/systemd/systemd
- image: geerlingguy/docker-fedora31-ansible:latest
- image: ghcr.io/artis3n/docker-arch-ansible:latest
- image: ghcr.io/artis3n/docker-opensuse-tumbleweed-ansible:latest
- image: ghcr.io/artis3n/docker-opensuse-leap-ansible:latest
command: /lib/systemd/systemd
uses: ./.github/workflows/molecule.yml
with:
image: ${{ matrix.image }}
command: ${{ matrix.command }}
secrets:
tailscale_key: ${{ secrets.TAILSCALE_CI_KEY }}
# Systems that aren't working with cgroups v2 on ubuntu 22.04, but works on ubuntu 20.04
molecule-legacy:
name: "Test Legacy Distro"
strategy:
fail-fast: false
matrix:
include:
- image: geerlingguy/docker-centos7-ansible:latest
command: /usr/lib/systemd/systemd
- image: ghcr.io/artis3n/docker-amazonlinux2-ansible:latest
command: /usr/lib/systemd/systemd
- image: geerlingguy/docker-ubuntu1604-ansible:latest
command: /lib/systemd/systemd
uses: ./.github/workflows/molecule.yml
with:
image: ${{ matrix.image }}
command: ${{ matrix.command }}
runner: ubuntu-20.04
secrets:
tailscale_key: ${{ secrets.TAILSCALE_CI_KEY }}
molecule-skip-auth:
name: "Test Skip Authentication"
runs-on: ubuntu-22.04
environment: E2E
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependency manager
run: pipx install poetry
- name: Set up Python 3.x
id: setup-python
uses: actions/[email protected]
with:
python-version: "3.11"
cache: 'poetry'
- name: Install packages
run: poetry install --no-interaction
- name: Molecule - Skip Authentication
run: poetry run molecule test --scenario-name skip-authentication
molecule-args:
name: "Test Up Args"
runs-on: ubuntu-22.04
environment: E2E
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependency manager
run: pipx install poetry
- name: Set up Python 3.x
id: setup-python
uses: actions/[email protected]
with:
python-version: "3.11"
cache: 'poetry'
- name: Install packages
run: poetry install --no-interaction
- name: Molecule - Custom Arguments Validation
run: poetry run molecule test --scenario-name args
env:
TAILSCALE_CI_KEY: "${{ secrets.TAILSCALE_CI_KEY }}"
molecule-state-present:
name: "Test State Idempotency"
runs-on: ubuntu-22.04
environment: E2E
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependency manager
run: pipx install poetry
- name: Set up Python 3.x
id: setup-python
uses: actions/[email protected]
with:
python-version: "3.11"
cache: 'poetry'
- name: Install packages
run: poetry install --no-interaction
- name: Molecule - State Present
run: poetry run molecule test --scenario-name state-present
env:
TAILSCALE_CI_KEY: "${{ secrets.TAILSCALE_CI_KEY }}"
molecule-headscale:
name: "Test Headscale Compatibility"
runs-on: ubuntu-22.04
environment: E2E
strategy:
fail-fast: false
matrix:
scenario:
- default
- state-absent
- idempotent-up
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependency manager
run: pipx install poetry
- name: Set up Python 3.x
id: setup-python
uses: actions/[email protected]
with:
python-version: "3.11"
cache: 'poetry'
- name: Install packages
run: poetry install --no-interaction
- name: Run scenario with Headscale
run: poetry run molecule test --scenario-name ${{ matrix.scenario }}
env:
TAILSCALE_CI_KEY: "unused"
USE_HEADSCALE: "true"