Skip to content

Commit 8383101

Browse files
committed
github bot: add jobs for meson
* Use meson CPU family names in matrix * Install meson and ninja * Create a cross compilation file * Build with meson * Build nolibc variant with meson * Test installation with meson Signed-off-by: Florian Fischer <[email protected]>
1 parent b71217c commit 8383101

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
cxx: clang++
2929

3030
# x86 (32-bit) gcc
31-
- arch: i686
31+
- arch: x86
3232
cc_pkg: gcc-i686-linux-gnu
3333
cxx_pkg: g++-i686-linux-gnu
3434
cc: i686-linux-gnu-gcc
@@ -49,14 +49,14 @@ jobs:
4949
cxx: arm-linux-gnueabi-g++
5050

5151
# powerpc64
52-
- arch: powerpc64
52+
- arch: ppc64
5353
cc_pkg: gcc-powerpc64-linux-gnu
5454
cxx_pkg: g++-powerpc64-linux-gnu
5555
cc: powerpc64-linux-gnu-gcc
5656
cxx: powerpc64-linux-gnu-g++
5757

5858
# powerpc
59-
- arch: powerpc
59+
- arch: ppc
6060
cc_pkg: gcc-powerpc-linux-gnu
6161
cxx_pkg: g++-powerpc-linux-gnu
6262
cc: powerpc-linux-gnu-gcc
@@ -85,6 +85,8 @@ jobs:
8585

8686
env:
8787
FLAGS: -g -O3 -Wall -Wextra -Werror
88+
MESON_BUILDDIR: build
89+
MESON_CROSS_FILE: /tmp/cross-env.txt
8890

8991
steps:
9092
- name: Checkout source
@@ -114,7 +116,7 @@ jobs:
114116
115117
- name: Build nolibc
116118
run: |
117-
if [[ "${{matrix.arch}}" == "x86_64" || "${{matrix.arch}}" == "i686" || "${{matrix.arch}}" == "aarch64" ]]; then \
119+
if [[ "${{matrix.arch}}" == "x86_64" || "${{matrix.arch}}" == "x86" || "${{matrix.arch}}" == "aarch64" ]]; then \
118120
make clean; \
119121
./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}} --nolibc; \
120122
make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS"; \
@@ -125,3 +127,38 @@ jobs:
125127
- name: Test install command
126128
run: |
127129
sudo make install;
130+
131+
- name: Install meson
132+
run: |
133+
sudo apt-get update -y;
134+
sudo apt-get install -y meson;
135+
136+
- name: Generate meson cross file
137+
run: |
138+
{ \
139+
echo -e "[host_machine]\nsystem = 'linux'"; \
140+
echo "cpu_family = '${{matrix.arch}}'"; \
141+
echo "cpu = '${{matrix.arch}}'"; \
142+
echo "endian = 'big'"; \
143+
echo -e "[binaries]\nc = '/usr/bin/${{matrix.cc}}'"; \
144+
echo "cpp = '/usr/bin/${{matrix.cxx}}'"; \
145+
} > "$MESON_CROSS_FILE"
146+
147+
- name: Build with meson
148+
run: |
149+
meson setup "$MESON_BUILDDIR" -Dtests=true -Dexamples=true --cross-file "$MESON_CROSS_FILE";
150+
ninja -C "$MESON_BUILDDIR";
151+
152+
- name: Build nolibc with meson
153+
run: |
154+
if [[ "${{matrix.arch}}" == "x86_64" || "${{matrix.arch}}" == "x86" || "${{matrix.arch}}" == "aarch64" ]]; then \
155+
rm -r "$MESON_BUILDDIR"; \
156+
meson setup "$MESON_BUILDDIR" -Dnolibc=true -Dtests=true -Dexamples=true --cross-file "$MESON_CROSS_FILE"; \
157+
ninja -C "$MESON_BUILDDIR"; \
158+
else \
159+
echo "Skipping nolibc build, this arch doesn't support building liburing without libc"; \
160+
fi;
161+
162+
- name: Test meson install
163+
run: |
164+
sudo meson install -C "$MESON_BUILDDIR"

0 commit comments

Comments
 (0)