From 26880724aae5544e2c9930ac553f395c1e61df38 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 15 Jun 2026 22:31:15 +0300 Subject: [PATCH] GH: add ci configuration Add simple CI configuration testing that the tool build. Signed-off-by: Dmitry Baryshkov --- .github/workflows/ci.yml | 85 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7840bf6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright (c) 2023 Linaro Ltd. +# +name: "Builds" +on: + pull_request: + push: + schedule: + # Run periodically to check that it still compiles + - cron: '13 13 * * 1' + workflow_dispatch: + +jobs: + job: + name: Build + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + container: + - debian:testing + - debian:trixie + - debian:bookworm + - ubuntu:resolute + - ubuntu:noble + - ubuntu:jammy + target: + - native + - aarch64-linux-gnu + - arm-linux-gnueabihf + + container: + image: ${{ matrix.container }} + + steps: + - name: Git checkout + uses: actions/checkout@v6 + + - name: Install meson + run: | + apt update + apt -y install --no-install-recommends meson build-essential + + - name: Install cross-compilers + if: matrix.target != 'native' + run: | + apt -y install gcc-${{ matrix.target }} + FAMILY=$(echo ${{ matrix.target }} | cut -d- -f 1) + if [ "${FAMILY}" = "aarch64" ] ; then + CPU="arm64" + elif [ "${FAMILY}" = "arm" ] ; then + CPU="arm" + else + echo "Unknown CPU family ${FAMILY}" + exit 1 + fi + cat > cross.txt << EOF + [binaries] + c = '${{ matrix.target }}-gcc' + strip = '${{ matrix.target }}-strip' + pkgconfig = 'pkg-config' + [host_machine] + system = 'linux' + cpu_family = '${FAMILY}' + cpu = 'arm64' + endian = 'litle' + [properties] + pkg_config_libdir = '/usr/lib/${{ matrix.target }}/pkgconfig' + EOF + cat cross.txt + + - name: Build + run: | + if [ ${{ matrix.target }} = "native" ] ; then + meson setup . build --werror + else + meson setup --cross-file cross.txt . build --werror + fi + ninja -C build + ninja -C build install