-
Notifications
You must be signed in to change notification settings - Fork 16
248 lines (223 loc) · 7.7 KB
/
ci.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
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
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2021 Canonical Ltd.
# Copyright (c) 2023 Linaro Ltd
# Author: Krzysztof Kozlowski <[email protected]>
#
# Loosely based on: https://github.com/linux-test-project/ltp
# https://github.com/linux-nfc/neard
#
name: "Builds"
on:
pull_request:
push:
schedule:
# Run at 1:01 PM, every Tuesday
- cron: '1 13 * * 2'
workflow_dispatch:
jobs:
job:
name: Build
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
arch: [x86-64]
family: [x86-64]
compiler: [gcc, clang]
container:
- alpine:edge
- alpine:latest
- archlinux:latest
- debian:testing
- debian:stable
- debian:bookworm
- debian:bullseye
- debian:buster
# Fails on configure on GCC and clang (process restrictions?)
# - fedora:rawhide
- fedora:latest
- fedora:40
- fedora:39
- fedora:38
- fedora:37
- ubuntu:latest
- ubuntu:noble
- ubuntu:mantic
- ubuntu:jammy
- ubuntu:focal
# On Ubuntu Bionic the Meson doesn't support feature options
#- ubuntu:bionic
# Meson version on Ubuntu Xenial is really too old
#- ubuntu:xenial
cross_compile: [""]
variant: [""]
include:
# Debian 32-bit builds
- container: "debian:testing"
arch: i386
family: x86
compiler: gcc
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386
- container: "debian:stable"
arch: i386
family: x86
compiler: gcc
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386
- container: "debian:bookworm"
arch: i386
family: x86
compiler: gcc
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386
- container: "debian:buster"
arch: i386
family: x86
compiler: gcc -m32
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386
# Debian cross compilation builds
- container: "debian:testing"
arch: armhf
family: arm
compiler: arm-linux-gnueabihf-gcc
cross_compile: arm-linux-gnueabihf
pkg_config_path: /usr/lib/arm-linux-gnueabihf/pkgconfig
variant: cross-compile
- container: "debian:testing"
arch: arm64
family: aarch64
compiler: aarch64-linux-gnu-gcc
cross_compile: aarch64-linux-gnu
pkg_config_path: /usr/lib/aarch64-linux-gnu/pkgconfig
variant: cross-compile
- container: "debian:testing"
arch: ppc64el
family: ppc64
compiler: powerpc64le-linux-gnu-gcc
cross_compile: powerpc64le-linux-gnu
pkg_config_path: /usr/lib/powerpc64le-linux-gnu/pkgconfig
variant: cross-compile
- container: "debian:testing"
arch: s390x
family: s390x
compiler: s390x-linux-gnu-gcc
cross_compile: s390x-linux-gnu
pkg_config_path: /usr/lib/s390x-linux-gnu/pkgconfig
variant: cross-compile
- container: "debian:stable"
arch: armhf
family: arm
compiler: arm-linux-gnueabihf-gcc
cross_compile: arm-linux-gnueabihf
pkg_config_path: /usr/lib/arm-linux-gnueabihf/pkgconfig
variant: cross-compile
- container: "debian:stable"
arch: arm64
family: aarch64
compiler: aarch64-linux-gnu-gcc
cross_compile: aarch64-linux-gnu
pkg_config_path: /usr/lib/aarch64-linux-gnu/pkgconfig
variant: cross-compile
- container: "debian:stable"
arch: ppc64el
family: ppc64
compiler: powerpc64le-linux-gnu-gcc
cross_compile: powerpc64le-linux-gnu
pkg_config_path: /usr/lib/powerpc64le-linux-gnu/pkgconfig
variant: cross-compile
- container: "debian:stable"
arch: s390x
family: s390x
compiler: s390x-linux-gnu-gcc
cross_compile: s390x-linux-gnu
pkg_config_path: /usr/lib/s390x-linux-gnu/pkgconfig
variant: cross-compile
container:
image: ${{ matrix.container }}
env:
ARCH: ${{ matrix.arch }}
FAMILY: ${{ matrix.family }}
CC: ${{ matrix.compiler }}
CROSS_COMPILE: ${{ matrix.cross_compile }}
PKG_CONFIG_PATH: ${{ matrix.pkg_config_path }}
VARIANT: ${{ matrix.variant }}
steps:
- name: Show OS
run: cat /etc/os-release
- name: Show env (matrix settings)
run: |
echo "ARCH: $ARCH"
echo "FAMILY: $FAMILY"
echo "CC: $CC"
echo "CROSS_COMPILE: $CROSS_COMPILE"
echo "VARIANT: $VARIANT"
echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH"
- name: Git checkout
uses: actions/checkout@v4
- name: Install additional packages
run: |
INSTALL=${{ matrix.container }}
INSTALL="${INSTALL%%:*}"
INSTALL="${INSTALL%%/*}"
./ci/$INSTALL.sh
if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi
- name: Compiler version
run: $CC --version
- name: Display environment and Linux version
run: |
test -f /etc/issue && cat /etc/issue
echo "############################################"
lsb_release -a || true
echo "############################################"
cat /usr/include/linux/version.h
echo "############################################"
uname -a
echo "############################################"
cat /proc/cmdline
echo "############################################"
printenv
# i386 build on x86_64 only requires passing -m32 to CFLAGS & LDFLAGS
- name: Meson init for i386
if: ${{ matrix.variant == 'i386' }}
run: |
mkdir build
CFLAGS="-m32" LDFLAGS="-m32" meson setup --errorlogs --werror . build
- name: Meson init with cross compile
if: ${{ matrix.variant == 'cross-compile' }}
run: |
# Generate cross compile file (see https://mesonbuild.com/Cross-compilation.html#cross-compilation)
echo "[binaries]" > cross.txt
echo "c = '${CROSS_COMPILE}-gcc'" >> cross.txt
echo "strip = '${CROSS_COMPILE}-strip'" >> cross.txt
# Forcing pkgconfig binary to 'pkg-config' is required for cross build to work
echo "pkgconfig = 'pkg-config'" >> cross.txt
echo "[host_machine]" >> cross.txt
echo "system = 'linux'" >> cross.txt
echo "cpu_family = '${FAMILY}'" >> cross.txt
echo "cpu = '${ARCH}'" >> cross.txt
echo "endian = 'little'" >> cross.txt
echo "[properties]" >> cross.txt
echo "pkg_config_libdir = '${PKG_CONFIG_PATH}'" >> cross.txt
cat cross.txt
mkdir build
meson setup --errorlogs --werror --cross-file cross.txt . build
- name: Meson init
if: ${{ matrix.variant == '' }}
run: |
mkdir build
meson setup --errorlogs --werror . build
- name: Compile
run: ninja -C build
- name: Install
run: ninja -C build install