-
Notifications
You must be signed in to change notification settings - Fork 345
218 lines (191 loc) · 8.53 KB
/
buildmaster.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
name: master
on: # yamllint disable-line rule:truthy
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
name: build
strategy:
matrix:
os: ['ubuntu-20.04', 'ubuntu-22.04', 'macos-12', 'macos-13', 'macos-14']
arch: ['x86_64', 'arm64']
cc: ['gcc', 'clang']
include:
- cc: 'gcc'
cxx: 'g++'
- cc: 'clang'
cxx: 'clang++'
exclude:
- os: 'ubuntu-20.04'
arch: 'arm64'
- os: 'ubuntu-22.04'
arch: 'arm64'
- os: 'macos-12'
arch: 'arm64'
- os: 'macos-13'
arch: 'arm64'
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout master
uses: actions/checkout@v3
- name: Setup build environment
run: |
echo "MYTHTV_CONFIG=--prefix=${{ github.workspace }}/build/install --cc=${{ matrix.cc }} --cxx=${{ matrix.cxx }}" >> $GITHUB_ENV
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
# As some OSes can cross-compile, establish defaule configrue/make
# commands which can be overided as appropriate
echo "CONFIGURE_CMD=./configure" >> $GITHUB_ENV
echo "MAKE_CMD=make" >> $GITHUB_ENV
# GitHub caches are immutable, so to update a cache, use a unique key with
# a prefixed restore-key. GitHub will rotate the caches within their 10 GB
# storage limit.
# See https://github.com/actions/cache/blob/471fb0c87e5d7210f339d8ea2e01505ddafd793d/workarounds.md#update-a-cache
- name: Check ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ matrix.os }}-${{ matrix.cc }}-ccache-${{ github.sha }}
restore-keys: ${{ matrix.os }}-${{ matrix.cc }}-ccache
# macOS runners on github use homebrew which can place executables in
# an assortment of places. Also, the runners can in various unsynced
# states that need update to resolve linking
- name: Update environment (macOS)
env:
ARCH: ${{ matrix.arch }}
PYTHONVERS: 3.12
run: |
SYSARCH=$(/usr/bin/uname -m)
PKGMGR_CMD='brew'
HB_PREFIX=$(${PKGMGR_CMD} --prefix)
echo "HB_PREFIX=$HB_PREFIX" >> $GITHUB_ENV
echo "PYTHONVERS=${PYTHONVERS}" >> $GITHUB_ENV
${PKGMGR_CMD} update
# unlink python3 and remove all symlinks related to then
# specified python version
${PKGMGR_CMD} unlink python3
rm -f ${HB_PREFIX}/bin/*${PYTHONVERS}*
# remove azure-cli since we won't need install
${PKGMGR_CMD} uninstall azure-cli --force --ignore-dependencies
# brute force unlink and unpgrade python versions
# we'll re-link the specified version later
INSTALLED_PYTHONS=$($PKGMGR_CMD list|grep 'python@')
for PYTH in $INSTALLED_PYTHONS; do
${PKGMGR_CMD} unlink $PYTH
${PKGMGR_CMD} uninstall $PYTH --force --ignore-dependencies
done
# ask homebrew to cleanup any dead links and upgrade the
# remaining packages
${PKGMGR_CMD} cleanup
${PKGMGR_CMD} upgrade --force
## Install/re-install specified python version
${PKGMGR_CMD} reinstall python@${PYTHONVERS} --force
${PKGMGR_CMD} link python@${PYTHONVERS} --force --overwrite
# macOS based github runners starting at macos-14 only run on arm64
# architectures. To generate x86_64 based executable, the arch
# -x86_64 command is needed before any brew commands, make, and
# install to run as x86_64 via Rosetta2.
if [ "$SYSARCH" = "$ARCH" ]; then
# this is a cross-compile
PKGMGR_CMD="arch -${ARCH} $PKGMGR_CMD"
echo "CONFIGURE_CMD=arch -${ARCH} $CONFIGURE_CMD" >> $GITHUB_ENV
echo "MAKE_CMD=arch -${ARCH} $MAKE_CMD" >> $GITHUB_ENV
fi
echo "PKGMGR_CMD=$PKGMGR_CMD" >> $GITHUB_ENV
if: runner.os == 'macOS'
# N.B. These dependencies are for the master branch. Unlike the ansible
# playlists they do not include old dependencies that may be required for
# older versions. The list is intended to provide as much code coverage as
# possible (i.e. enable as many options as possible)
- name: Install core dependencies (linux)
run: |
sudo apt update
sudo apt install ccache qt5-qmake qtscript5-dev nasm libsystemd-dev \
libfreetype6-dev libmp3lame-dev libx264-dev libx265-dev \
libxrandr-dev libxml2-dev libavahi-compat-libdnssd-dev \
libasound2-dev liblzo2-dev libhdhomerun-dev libsamplerate0-dev \
libva-dev libdrm-dev libvdpau-dev libass-dev libpulse-dev \
libcec-dev libssl-dev libtag1-dev libbluray-dev libbluray-bdj \
libgnutls28-dev libqt5webkit5-dev libvpx-dev python3-mysqldb \
python3-lxml python3-setuptools libdbi-perl libdbd-mysql-perl \
libnet-upnp-perl libio-socket-inet6-perl libxml-simple-perl \
libqt5sql5-mysql libwayland-dev qtbase5-private-dev libzip-dev \
libsoundtouch-dev
if: runner.os == 'Linux'
- name: Install core dependencies (macOS)
env:
OS_VERS: ${{ matrix.os }}
run: |
${PKGMGR_CMD} install pkg-config ccache qt@5 nasm libsamplerate \
taglib lzo libcec libbluray libass libhdhomerun dav1d x264 x265 \
libvpx openssl sound-touch lame freetype libass libiconv libxml2 \
libzip XviD zlib pyenv-virtualenv python-lxml python-requests \
python-setuptools --force --overwrite
${PKGMGR_CMD} link qt@5 --force
# macos-14 updated the linker and needs to be run in "classic" mode
case $OS_VERS in
macos-14 | macos-13)
LDFLAGS="-Wl,-ld_classic"
;;
esac
# homebrew uses different prefixes on x86_64 and arm64, find the
# correct one and setup the correct build variables
C_INCLUDE_PATH=$HB_PREFIX/include:$C_INCLUDE_PATH
echo "C_INCLUDE_PATH=$C_INCLUDE_PATH" >> $GITHUB_ENV
CPLUS_INCLUDE_PATH=$HB_PREFIX/include:$CPLUS_INCLUDE_PATH
echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
LDFLAGS="-L$HB_PREFIX/lib $LDFLAGS"
echo "LDFLAGS=$LDFLAGS" >> $GITHUB_ENV
LIBRARY_PATH=$HB_PREFIX/lib:$LIBRARY_PATH
echo "LIBRARY_PATH=$LIBRARY_PATH" >> $GITHUB_ENV
PKG_CONFIG_PATH=$HB_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
if: runner.os == 'macOS'
- name: ccache statistics [pre]
run: |
ccache -sV
- name: Configure core
working-directory: ./mythtv
run: ${CONFIGURE_CMD} $MYTHTV_CONFIG --enable-libmp3lame --enable-libvpx
--enable-libx264 --enable-libx265 --enable-bdjava --enable-vulkan
- name: Make core
working-directory: ./mythtv
run: ${MAKE_CMD} all_no_test -j4
- name: Install core
working-directory: ./mythtv
run: ${MAKE_CMD} install
# QTest requires a QT SQL plugin - but there are currently none available
# via brew on macOS
- name: Unit test core
working-directory: ./mythtv
run: ${MAKE_CMD} test
if: runner.os == 'Linux'
- name: Install plugin dependencies (linux)
run: sudo apt install libvorbis-dev libflac++-dev libminizip-dev
libcdio-dev libcdio-paranoia-dev python3-pycurl libxml-xpath-perl
libdate-manip-perl libdatetime-format-iso8601-perl
libsoap-lite-perl libjson-perl libimage-size-perl
if: runner.os == 'Linux'
- name: Install plugin dependencies (ubuntu-20.04)
run: sudo apt install python3-oauth
if: matrix.os == 'ubuntu-20.04'
- name: Install plugin dependencies (ubuntu-22.04)
run: sudo apt install python3-oauthlib
if: matrix.os == 'ubuntu-22.04'
- name: Install plugin dependencies (macOS)
run: ${PKGMGR_CMD} install minizip flac libvorbis libcdio python-pycurl
python-oauthlib --force --overwrite
if: runner.os == 'macOS'
- name: Configure plugins
working-directory: ./mythplugins
run: ${CONFIGURE_CMD} $MYTHTV_CONFIG
- name: Make plugins
working-directory: ./mythplugins
run: ${MAKE_CMD} -j4
- name: ccache statistics [post]
run: |
ccache -sV