-
Notifications
You must be signed in to change notification settings - Fork 38
255 lines (226 loc) · 8.94 KB
/
test-suite.yaml
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: Test suite
on: [push, pull_request]
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
MAKEFLAGS: -j4
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-amd64-gcc-14
os: ubuntu-24.04
arch: amd64
compiler: gcc
version: 14
- name: ubuntu-amd64-gcc-14-static
os: ubuntu-24.04
arch: amd64
compiler: gcc
version: 14
static: true
- name: ubuntu-amd64-clang-19
os: ubuntu-24.04
arch: amd64
compiler: clang
version: 19
# - name: ubuntu-i386-gcc-12
# os: ubuntu-22.04
# arch: i386
# host: i686-linux-gnu
# compiler: gcc
# version: 12
- name: ubuntu-armhf-gcc-14
os: ubuntu-24.04
arch: armhf
host: arm-linux-gnueabihf
compiler: gcc
version: 14
- name: ubuntu-arm64-gcc-14
os: ubuntu-24.04
arch: arm64
host: aarch64-linux-gnu
compiler: gcc
version: 14
- name: macos-13-amd64-xcode
os: macos-13
compiler: xcode
- name: macos-15-arm64-xcode
os: macos-15
compiler: xcode
luajit: false
steps:
- name: Set up env
run: |
echo "echo \"\$1=\$2\" >> \$GITHUB_ENV" | sudo tee /usr/local/bin/set-env >/dev/null
sudo chmod +x /usr/local/bin/set-env
- name: Checkout
uses: actions/checkout@v4
- name: Install compiler (gcc)
if: runner.os == 'Linux' && matrix.compiler == 'gcc'
run: |
if [ "${{ matrix.arch }}" != "amd64" ]; then
sudo dpkg --add-architecture ${{ matrix.arch }}
sudo sed '/^Signed-By:/a Architectures: amd64' -i /etc/apt/sources.list.d/*.sources
sudo add-apt-repository -n -y -S "deb http://ports.ubuntu.com $(lsb_release -sc) main universe"
sudo add-apt-repository -n -y -S "deb http://ports.ubuntu.com $(lsb_release -sc)-updates main universe"
sudo add-apt-repository -n -y -S "deb http://ports.ubuntu.com $(lsb_release -sc)-security main universe"
sudo sed 's/^deb /deb [arch=arm64,armhf] /' -i /etc/apt/sources.list.d/archive_uri-http_ports_ubuntu_com-*.list
fi
sudo apt-get update
CC=gcc
CXX=g++
PKG=g++
if [ -n "${{ matrix.version }}" ]; then
CC=$CC-${{ matrix.version }}
CXX=$CXX-${{ matrix.version }}
PKG=$PKG-${{ matrix.version }}
fi
if [ -n "${{ matrix.host }}" ]; then
CC=${{ matrix.host }}-$CC
CXX=${{ matrix.host }}-$CXX
PKG=$PKG-${{ matrix.host }}
fi
sudo apt-get install $PKG
set-env HOST_CC "$CC"
set-env HOST_CXX "$CXX"
if [ "${{ matrix.arch }}" = "i386" ]; then
set-env CFLAGS "-msse2 -mfpmath=sse"
fi
if [ -n "${{ matrix.host }}" ]; then
set-env HOST "--host=${{ matrix.host }}"
fi
if [ "${{ matrix.sanitizer }}" = "true" ]; then
SAN="-fsanitize=undefined -fsanitize=address,pointer-compare,pointer-subtract"
set-env CFLAGS "$SAN"
set-env CXXFLAGS "$SAN"
set-env LDFLAGS "$SAN"
set-env UBSAN_OPTIONS "print_stacktrace=1"
fi
- name: Install compiler (clang)
if: runner.os == 'Linux' && matrix.compiler == 'clang'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository -y "deb http://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-${{ matrix.version }} main"
sudo apt-get update
sudo apt-get install clang-${{ matrix.version }}
set-env HOST_CC "clang-${{ matrix.version }}"
set-env HOST_CXX "clang++-${{ matrix.version }}"
set-env CXXFLAGS "-Wno-error=vla-cxx-extension"
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
env:
LIBS: >
ev asound2 x264 x265 speexdsp png freetype6 zvbi gcrypt tasn1 dvbv5
udev avcodec avformat swresample swscale gl1-mesa glu1-mesa
srt-gnutls gnutls28 ssl
LIBS_FULL: ebur128 dvbcsa
run: |
if [ "${{ matrix.arch }}" != "i386" ]; then
LIBS="$LIBS $LIBS_FULL"
fi
if [ "${{ matrix.arch }}" != "amd64" ]; then
sudo apt-get install qemu-user-binfmt
fi
sudo apt-get install valgrind nasm elfutils \
$(printf '%s:${{ matrix.arch }} ' libc6-dbg luajit) \
$(printf 'lib%s-dev:${{ matrix.arch }} ' $LIBS)
if [ -n "${{ matrix.host }}" ]; then
set-env DISABLE_VALGRIND "1"
fi
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
# temporary fix for https://github.com/actions/setup-python/issues/577
rm -f /usr/local/bin/2to3*
rm -f /usr/local/bin/idle3*
rm -f /usr/local/bin/pydoc3*
rm -f /usr/local/bin/python3*
brew install autoconf automake libtool pkg-config nasm ffmpeg \
freetype libebur128 libev libgcrypt libtasn1 speex x264 x265 luajit
BREW_PREFIX="$(brew --prefix)"
set-env HOST_CC "clang"
set-env HOST_CXX "clang++"
set-env CFLAGS "-Wno-error=deprecated-declarations -fsanitize=undefined -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-recover=all -fno-omit-frame-pointer -fno-optimize-sibling-calls -I$BREW_PREFIX/include"
set-env LDFLAGS "-fsanitize=undefined -fsanitize=address -L$BREW_PREFIX/lib"
set-env DISABLE_VALGRIND "1"
set-env INSERT_LIBRARIES "$(clang -print-search-dirs | sed -n 's/^libraries: =//p')/lib/darwin/libclang_rt.asan_osx_dynamic.dylib"
set-env UBSAN_OPTIONS "print_stacktrace=1"
- name: Install bitstream
run: |
git clone --depth 1 https://code.videolan.org/videolan/bitstream.git
make -C bitstream install PREFIX="$PWD/usr-bitstream"
set-env PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$PWD/usr-bitstream/share/pkgconfig"
- name: Build and install libamt
if: runner.os == 'Linux' && (matrix.arch == 'amd64' || matrix.arch == 'i386')
run: |
if [ "${{ matrix.arch }}" = "i386" ]; then
LIBAMT_PLATFORM="PLATFORM32=1"
fi
git clone --depth 1 https://github.com/cisco/SSMAMTtools.git
make -C SSMAMTtools/build/linux \
CC="$HOST_CC -fPIC" \
TARGET=libamt.a \
WFLAGS=-Wno-int-conversion \
$LIBAMT_PLATFORM
sudo install -D SSMAMTtools/include/amt.h /usr/local/include/amt.h
sudo install -D SSMAMTtools/lib/linux/libamt.a /usr/local/lib/libamt.a
- name: Build and install libdvbcsa
if: runner.os == 'macOS' || matrix.arch == 'i386'
run: |
git clone --depth 1 https://github.com/glenvt18/libdvbcsa.git
cd libdvbcsa
./bootstrap
./configure $HOST CC="$HOST_CC"
sudo make install
- name: Configure
run: |
autoreconf -i
if [ "${{ matrix.static }}" = "true" ]; then
STATIC="--disable-shared"
fi
if [ "${{ matrix.luajit }}" != "false" ]; then
LUAJIT="--enable-luajit"
fi
CONFIGURE_FLAGS="$LUAJIT $STATIC --disable-silent-rules $HOST CC=\"$HOST_CC\" CXX=\"$HOST_CXX\" CFLAGS=\"-Werror -Wno-error=deprecated-declarations -O2 -g -gdwarf-4 -fdiagnostics-color=always $CFLAGS\" CXXFLAGS=\"-Werror -O2 -g -fdiagnostics-color=always $CXXFLAGS\" LDFLAGS=\"$LDFLAGS\""
set-env CONFIGURE_FLAGS "$CONFIGURE_FLAGS"
eval ./configure $CONFIGURE_FLAGS
- name: Archive config log
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}_config.log
path: config.log
- name: Build and test
run: >
make distcheck
DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"
AM_COLOR_TESTS="always"
VERBOSE=1
coding-style:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
env:
LIBS: ev avutil dvbcsa srt-gnutls gnutls28
run: |
sudo apt-get update
sudo apt-get install $(printf 'lib%s-dev ' $LIBS)
- name: Configure
run: |
autoreconf -i
./configure
- name: Check whitespaces
run: make check-whitespace
- name: Check headers
env:
AM_COLOR_TESTS: always
run: make check-headers
- name: Check tests
env:
AM_COLOR_TESTS: always
run: make check-tests