-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (115 loc) · 3.88 KB
/
ci.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
---
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '*'
schedule:
# Run at 3pm on Friday.
# REF: https://crontab.guru/#0_3_*_*_5
- cron: "0 3 * * 5"
env:
# Colors
# REF: http://web.archive.org/web/20230608140615/https://www.jeffgeerling.com/blog/2020/getting-colorized-output-molecule-and-ansible-on-github-actions-ci
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
# YAML Output
# REF: http://web.archive.org/web/20220707112219/https://www.jeffgeerling.com/blog/2018/use-ansibles-yaml-callback-plugin-better-cli-experience
ANSIBLE_STDOUT_CALLBACK: 'yaml'
ANSIBLE_LOAD_CALLBACK_PLUGINS: true
# SSH Pipelining
ANSIBLE_PIPELINING: true
ANSIBLE_SSH_CONTROL_PATH: '/tmp/ansible-ssh-%%h-%%p-%%r'
# Task Timeout
# Requires Ansible 2.10
# REF: https://web.archive.org/web/20230819083945/https://docs.ansible.com/ansible/latest/reference_appendices/config.html#task-timeout
ANSIBLE_TASK_TIMEOUT: 120 # seconds
defaults:
run:
working-directory: 'jason_riddle.tailscale'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'jason_riddle.tailscale'
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install yamllint
- name: Lint code.
run: |
yamllint .
molecule:
name: Molecule
runs-on: ubuntu-latest
strategy:
matrix:
distro:
- rockylinux8
# TODO: Unable to install.
# - fedora38
- ubuntu2004 # Focal Fossa
- ubuntu1804 # Bionic Beaver
- debian11 # Bullseye
- debian10 # Buster
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'jason_riddle.tailscale'
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install ansible molecule molecule-plugins[docker] docker
- name: Set HOSTNAME.
run: echo "HOSTNAME=$(cat /etc/hostname)" >> $GITHUB_ENV
- name: Run Molecule default test.
run: |
molecule test --scenario-name default
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
- name: Run Molecule up test.
run: |
molecule test --scenario-name up
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
TAILSCALE_AUTHKEY: "${{ secrets.TAILSCALE_AUTHKEY }}"
# TODO: Not working..
# - name: Run Molecule up-with-oauth test.
# run: |
# molecule test --scenario-name up-with-oauth
# env:
# MOLECULE_DISTRO: ${{ matrix.distro }}
# MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
# TAILSCALE_OAUTHKEY: "${{ secrets.TAILSCALE_OAUTHKEY }}"
# TODO: serve and funnel command line arguments have changed.
# See https://tailscale.com/blog/reintroducing-serve-funnel/.
# - name: Run Molecule serve test.
# run: |
# molecule test --scenario-name serve
# env:
# MOLECULE_DISTRO: ${{ matrix.distro }}
# MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
# TAILSCALE_AUTHKEY: "${{ secrets.TAILSCALE_AUTHKEY }}"
# TODO: serve and funnel command line arguments have changed.
# See https://tailscale.com/blog/reintroducing-serve-funnel/.
# - name: Run Molecule funnel test.
# run: |
# molecule test --scenario-name funnel
# env:
# MOLECULE_DISTRO: ${{ matrix.distro }}
# MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
# TAILSCALE_AUTHKEY: "${{ secrets.TAILSCALE_AUTHKEY }}"