-
Notifications
You must be signed in to change notification settings - Fork 10
172 lines (142 loc) · 5.73 KB
/
ansible.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
---
name: Run ansible-playbook
#
# This workflow tests that ansible can successfully run
# on linux (macos ansible with macports is extremely
# slow to install and run ansible, and freebsd running
# in a macos vm is extremely fragile, so we defer to
# the full build workflow for macos). As most churn
# in this repo tends to happen in the linux ecosystem
# this provides a quick check for the most common cases.
#
# The containers are selected to be from the set of
# linux distributions and versions that are currently
# among the list (or will soon be for beta/rc) of the
# supported variants for ansible.
#
# Typically this takes less than 10 minutes to run.
#
on: # yamllint disable-line rule:truthy
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
ansible-linux:
name: Running ansible-playbook on ${{ matrix.container.desc }}
runs-on: ubuntu-latest
env:
TZ: Etc/UTC
strategy:
matrix:
container:
# Ubuntu group
- desc: 'Ubuntu 20.04 LTS (Focal Fossa)'
image: 'ubuntu:20.04'
ansibleopts: '--limit localhost'
- desc: 'Ubuntu 22.04 LTS (Jammy Jellyfish)'
image: 'ubuntu:22.04'
ansibleopts: '--limit localhost'
- desc: 'Ubuntu 23.10 (Mantic Minotaur)'
image: 'ubuntu:23.10'
ansibleopts: '--limit localhost'
- desc: 'Ubuntu 24.04 (Noble Numbat)'
image: 'ubuntu:24.04'
ansibleopts: '--limit localhost'
# Debian group
- desc: 'Debian 11 (Bullseye)'
image: 'debian:bullseye'
ansibleopts: '--limit localhost'
- desc: 'Debian 12 (Bookworm)'
image: 'debian:bookworm'
ansibleopts: '--limit localhost'
# Fedora group
- desc: 'Fedora 38'
image: 'quay.io/fedora/fedora:38'
ansibleopts: '--limit localhost'
- desc: 'Fedora 39'
image: 'quay.io/fedora/fedora:39'
ansibleopts: '--limit localhost'
- desc: 'Fedora Rawhide'
image: 'quay.io/fedora/fedora:rawhide'
ansibleopts: '--limit localhost'
# CentOS group
- desc: 'CentOS 8 Stream'
image: 'quay.io/centos/centos:stream8'
ansibleopts: '--limit localhost'
- desc: 'CentOS 9 Stream'
image: 'quay.io/centos/centos:stream9'
ansibleopts: '--limit localhost'
# Rocky Linux group
- desc: 'Rocky Linux 8'
image: 'rockylinux:8'
ansibleopts: '--limit localhost'
- desc: 'Rocky Linux 9'
image: 'rockylinux:9'
ansibleopts: '--limit localhost'
# openSUSE group
- desc: 'openSUSE Tumbleweed'
image: 'opensuse/tumbleweed:latest'
ansibleopts: '--limit localhost'
- desc: 'openSUSE Leap'
image: 'opensuse/leap:latest'
ansibleopts: '--limit localhost'
# Arch Linux group
- desc: 'Arch Linux'
image: 'archlinux:latest'
ansibleopts: '--limit localhost'
fail-fast: false
container:
image: ${{ matrix.container.image }}
steps:
- name: Detect OS release
run: |
. /etc/os-release
echo "OS_RELEASE_ID=$ID" >> $GITHUB_ENV
echo "OS_RELEASE_VERSION=$VERSION_ID" >> $GITHUB_ENV
echo "OS_RELEASE_VERSION_MAJOR=${VERSION_ID%%.*}" >> $GITHUB_ENV
echo "OS_RELEASE_VERSION_CODENAME=$VERSION_CODENAME" >> $GITHUB_ENV
- name: Debian OS obtain codename for prerelease vesions
run: echo "OS_RELEASE_VERSION_CODENAME=`dpkg --status tzdata | grep 'Provides' | cut -f2 -d'-'`" >> $GITHUB_ENV
if: env.OS_RELEASE_ID == 'debian' && env.OS_RELEASE_VERSION_CODENAME == ''
- name: Debian/Ubuntu OS update
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt update -y
apt upgrade -y
if: env.OS_RELEASE_ID == 'debian' || env.OS_RELEASE_ID == 'ubuntu'
- name: Debian/Ubuntu OS install ansible
env:
DEBIAN_FRONTEND: noninteractive
run: apt install ansible apt-utils -y
if: env.OS_RELEASE_ID == 'debian' || env.OS_RELEASE_ID == 'ubuntu'
- name: Redhat OS - add EPEL repo for EL linux (for ansible)
run: dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${{ env.OS_RELEASE_VERSION_MAJOR }}.noarch.rpm
if: env.OS_RELEASE_ID == 'centos' || env.OS_RELEASE_ID == 'rocky'
- name: Redhat/Fedora OS update
run: dnf upgrade -y
if: env.OS_RELEASE_ID == 'fedora' || env.OS_RELEASE_ID == 'centos' || env.OS_RELEASE_ID == 'rocky'
- name: Redhat/Fedora OS install ansible
run: dnf install ansible dnf-plugins-core -y
if: env.OS_RELEASE_ID == 'fedora' || env.OS_RELEASE_ID == 'centos' || env.OS_RELEASE_ID == 'rocky'
- name: OpenSUSE OS update
run: zypper update -y
if: env.OS_RELEASE_ID == 'opensuse-leap' || env.OS_RELEASE_ID == 'opensuse-tumbleweed'
- name: OpenSUSE OS install ansible
run: zypper install -y ansible tar gzip
if: env.OS_RELEASE_ID == 'opensuse-leap' || env.OS_RELEASE_ID == 'opensuse-tumbleweed'
- name: ArchLinux OS update
run: pacman --noconfirm -Syu
if: env.OS_RELEASE_ID == 'arch'
- name: ArchLinux OS install ansible
run: pacman --noconfirm -Sy ansible
if: env.OS_RELEASE_ID == 'arch'
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ansible
- name: Run ansible to install build requirements
working-directory: ansible
run: ansible-playbook ${{ matrix.container.ansibleopts }} mythtv.yml