-
-
Notifications
You must be signed in to change notification settings - Fork 67
168 lines (150 loc) · 5.23 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
---
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'
# Temporary - https://github.com/artis3n/ansible-role-tailscale/issues/432#issuecomment-1948954799
HEADSCALE_IMAGE: headscale/headscale:0.22
jobs:
molecule:
name: "Test Distros"
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: geerlingguy/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 }}
scenario: 'default'
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 Distros"
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
# Default version of Python in 16.04 is 3.5.2
# Ansible-core now requires 2.7 or 3.6 minimum.
#
# Therefore, while Tailscale supports Ubuntu 16.04,
# this role has deprecated support for it.
#
# - image: geerlingguy/docker-ubuntu1604-ansible:latest
# command: /lib/systemd/systemd
uses: ./.github/workflows/molecule.yml
with:
image: ${{ matrix.image }}
command: ${{ matrix.command }}
scenario: 'default'
runner: ubuntu-20.04
secrets:
tailscale_key: ${{ secrets.TAILSCALE_CI_KEY }}
molecule-state-absent:
name: "Run Molecule Scenario: state-absent"
uses: ./.github/workflows/molecule.yml
with:
scenario: 'state-absent'
secrets:
tailscale_key: ${{ secrets.TAILSCALE_CI_KEY }}
molecule-skip-auth:
name: "Run Molecule Scenario: skip-authentication"
uses: ./.github/workflows/molecule.yml
with:
scenario: 'skip-authentication'
secrets:
tailscale_key: ${{ secrets.TAILSCALE_CI_KEY }}
molecule-args:
name: "Run Molecule Scenario: args"
uses: ./.github/workflows/molecule.yml
with:
scenario: 'args'
secrets:
tailscale_key: ${{ secrets.TAILSCALE_CI_KEY }}
molecule-state-present:
name: "Run Molecule Scenario: state-idempotency"
uses: ./.github/workflows/molecule.yml
with:
scenario: 'state-idempotency'
secrets:
tailscale_key: ${{ secrets.TAILSCALE_CI_KEY }}
molecule-oauth:
name: "Run Molecule Scenario: oauth"
uses: ./.github/workflows/molecule.yml
with:
scenario: 'oauth'
secrets:
tailscale_key: ${{ secrets.TAILSCALE_OAUTH_CLIENT_SECRET }}
molecule-strategy-free:
name: "Run Molecule Scenario: strategy-free"
uses: ./.github/workflows/molecule.yml
with:
scenario: 'strategy-free'
secrets:
tailscale_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
- strategy-free
steps:
- uses: actions/checkout@v4
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/setup-python@v5
with:
python-version-file: pyproject.toml
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"