-
Notifications
You must be signed in to change notification settings - Fork 466
132 lines (113 loc) · 4.46 KB
/
linux-build.yml
File metadata and controls
132 lines (113 loc) · 4.46 KB
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
# Linux builds
name: linux CI
on: [push, pull_request]
jobs:
build-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Fully declare each matrix entry here, as otherwise it's possible
# to get unexpected results due to the way the entries get expanded
# (See https://magmanu.github.io/blog/tech/matrices-github-actions/)
include:
# x86-64, clang, configure, libdeflate
- os: ubuntu-latest
use-configure: use-configure
compiler: clang
use-libdeflate: use-libdeflate
sanitize: no-sanitize
run-extra-checks: no-extra-checks
# x86-64, gcc, configure, libdeflate, sanitize
- os: ubuntu-latest
use-configure: use-configure
compiler: gcc
use-libdeflate: use-libdeflate
sanitize: sanitize
run-extra-checks: no-extra-checks
# x86-64, gcc, no configure, run extra checks
- os: ubuntu-latest
use-configure: no-configure
compiler: gcc
use-libdeflate: use-libdeflate
sanitize: no-sanitize
run-extra-checks: run-extra-checks
# arm, gcc, configure, libdeflate
- os: ubuntu-24.04-arm
use-configure: use-configure
compiler: gcc
use-libdeflate: use-libdeflate
sanitize: no-sanitize
run-extra-checks: no-extra-checks
# x86-64, gcc, configure, zlib only, sanitize
- os: ubuntu-latest
use-configure: use-configure
compiler: gcc
use-libdeflate: no-libdeflate
sanitize: sanitize
run-extra-checks: no-extra-checks
env:
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
steps:
- name: Checkout
# This is actions/checkout@v6.0.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: true
persist-credentials: false
# Linux (ubuntu-latest) build
- name: Run apt
run: |
autoconf_pkgs=""
deflate_pkgs=""
if [ '${{ matrix.use-configure }}' = 'use-configure' ] ; then
autoconf_pkgs="autoconf automake"
fi
if [ '${{ matrix.use-libdeflate }}' = 'use-libdeflate' ] ; then
deflate_pkgs="libdeflate-dev"
fi
sudo apt-get update
sudo apt-get install -y --no-install-suggests --no-install-recommends $autoconf_pkgs make ${{ matrix.compiler }} perl zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev $deflate_pkgs
- name: Configure
if: ${{ matrix.use-configure == 'use-configure' }}
run: |
autoreconf -i
# Select configure options
libdeflate_opt='--without-libdeflate'
if [ '${{ matrix.use-libdeflate }}' = 'use-libdeflate' ] ; then
libdeflate_opt='--with-libdeflate'
fi
config_opts='--enable-werror --enable-plugins'
cc='${{ matrix.compiler }}'
cflags='-g -O3 -std=c99 -pedantic'
ldflags=''
if [ '${{ matrix.sanitize }}' = 'sanitize' ] ; then
config_opts='--enable-werror'
cflags='-g -Og -fsanitize=address,undefined -DHTS_ALLOW_UNALIGNED=0 -Wno-format-truncation -Wno-format-overflow'
ldflags='-fsanitize=address,undefined'
fi
# Run configure, and ensure that it did set -Werror
printf "\nRunning ./configure $config_opts ${libdeflate_opt}${cc:+ CC='$cc'}${cflags:+ CFLAGS='$cflags'}${ldflags:+ LDFLAGS='$ldflags'} ...\n\n"
{ ./configure $config_opts $libdeflate_opt ${cc:+CC="$cc"} ${cflags:+CFLAGS="$cflags"} ${ldflags:+LDFLAGS="$ldflags"} &&
{ grep -qE 'CFLAGS *=.*-Werror' config.mk ||
{ printf "\nStopping as -Werror was not set.\n" 1>&2 ; false ; } ;
} ;
} || { printf "\n### config.log content follows...\n\n" 1>&2 ; cat config.log ; false ; }
- name: Compile
run: |
if [ '${{ matrix.use-configure }}' = 'use-configure' ] ; then
make -j5
else
make -j5 CFLAGS='-g -O3 -Wall -Werror'
fi
- name: Check
run: |
if [ '${{ matrix.use-configure }}' = 'use-configure' ] ; then
make check
else
make check CFLAGS='-g -O3 -Wall -Werror'
fi
- name: Extra checks
if: ${{ matrix.run-extra-checks == 'run-extra-checks' }}
run: |
make test-shlib-exports check-untracked maintainer-check