-
Notifications
You must be signed in to change notification settings - Fork 38
234 lines (206 loc) · 7.96 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
name: Test suite
on: [push, pull_request]
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
MAKEFLAGS: -j3
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-amd64-gcc-12
os: ubuntu-22.04
arch: amd64
compiler: gcc
version: 12
- name: ubuntu-amd64-gcc-12-static
os: ubuntu-22.04
arch: amd64
compiler: gcc
version: 12
static: true
- name: ubuntu-amd64-clang-16
os: ubuntu-22.04
arch: amd64
compiler: clang
version: 16
# - name: ubuntu-i386-gcc-12
# os: ubuntu-22.04
# arch: i386
# host: i686-linux-gnu
# compiler: gcc
# version: 12
- name: ubuntu-armhf-gcc-12
os: ubuntu-22.04
arch: armhf
host: arm-linux-gnueabihf
compiler: gcc
version: 12
- name: ubuntu-arm64-gcc-12
os: ubuntu-22.04
arch: arm64
host: aarch64-linux-gnu
compiler: gcc
version: 12
- name: macos-12-xcode
os: macos-12
compiler: xcode
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@v3
- name: Install compiler (gcc)
if: runner.os == 'Linux' && matrix.compiler == 'gcc'
run: |
sudo dpkg --add-architecture ${{ matrix.arch }}
sudo sed 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
sudo apt-add-repository -n -y "deb [arch=arm64,armhf] http://ports.ubuntu.com $(lsb_release -sc) main universe"
sudo apt-add-repository -n -y "deb [arch=arm64,armhf] http://ports.ubuntu.com $(lsb_release -sc)-updates main universe"
sudo apt-add-repository -n -y "deb [arch=arm64,armhf] http://ports.ubuntu.com $(lsb_release -sc)-security main universe"
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"
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 }}"
- 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
sudo apt-get install \
valgrind nasm qemu-user-binfmt 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: |
brew install autoconf automake libtool pkg-config nasm ffmpeg \
freetype libebur128 libev libgcrypt libtasn1 speex x264 x265
brew install luajit --HEAD
set-env HOST_CC "clang"
set-env HOST_CXX "clang++"
set-env CFLAGS "-Wno-error=unused-command-line-argument -Wno-error=deprecated-declarations -fsanitize=undefined -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-optimize-sibling-calls"
set-env LDFLAGS "-fsanitize=undefined -fsanitize=address"
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"
- 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"
if [ "${{ matrix.static }}" = "true" ]; then
STATIC="--disable-shared"
fi
set-env CONFIGURE_FLAGS "--enable-luajit $STATIC --disable-silent-rules $HOST CC=\"$HOST_CC\" CXX=\"$HOST_CXX\" CFLAGS=\"-Werror -O2 -g -gdwarf-4 $CFLAGS\" CXXFLAGS=\"-Werror -O2 -g $CXXFLAGS\" LDFLAGS=\"$LDFLAGS\""
- 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
eval ./configure $CONFIGURE_FLAGS
- name: Archive config log
if: always()
uses: actions/upload-artifact@v1
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-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
env:
LIBS: ev avutil dvbcsa srt-gnutls gnutls28
run: |
sudo rm /etc/apt/sources.list.d/*
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