-
Notifications
You must be signed in to change notification settings - Fork 345
185 lines (165 loc) · 7.12 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
---
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 based github runners starting with macos-14 only run on the arm64
# architecture. 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.
- name: Check cross-compile environment (macOS)
env:
ARCH: ${{ matrix.arch }}
run: |
SYSARCH=$(/usr/bin/uname -m)
PKGMGR_CMD='brew'
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: |
brew update
${PKGMGR_CMD} install pkg-config ccache qt5 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
${PKGMGR_CMD} link qt5 --force
# macos-14 updated the linker and needs to be run in "classic" mode
case $OS_VERS in
macos-14)
LDFLAGS="-Wl,-ld_classic"
;;
esac
# homebrew uses different prefixes on x86_64 and arm64, find the
# correct one and setup the correct build variables
HB_PREFIX=$(${PKGMGR_CMD} --prefix)
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
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