From 83cdc93ca900e61b203e07198740668cb07a5f06 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 26 May 2026 15:41:25 +1000 Subject: [PATCH] ci: Add macOS build to GitHub Actions The codebase already has macOS support (dylib flags in the Makefile, macOS linker handling in meson.build), but CI only tests Linux, Windows, and FreeBSD. This means macOS regressions go unnoticed until a user reports them. Add a build-macos job that tests both Make and Meson builds on macos-latest. The runner ships with clang, flex, bison, python3, and git; only libyaml, swig, meson, ninja, and pkg-config are installed via Homebrew. Apple Clang uses -Wsign-compare by default, which trips on some lex generated code. Suppress the warning for the two flex-generated objects. We skip tests for now, because trees.S doesn't work with the MacOS assembler. Assisted-by: Claude:claude-opus-4-6 Signed-off-by: David Gibson --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ Makefile | 5 +++++ 2 files changed, 36 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad9ce17..294ebb2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,6 +71,37 @@ jobs: - name: Run check run: if ! meson test -C build; then cat build/meson-logs/testlog.txt; false; fi + build-macos: + runs-on: macos-latest + + strategy: + fail-fast: false + matrix: + build: [ "make", "meson" ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Dependencies + run: | + brew install libyaml swig meson ninja pkg-config + + - name: Build (Make) + if: matrix.build == 'make' + run: | + make + + - name: Setup (Meson) + if: matrix.build == 'meson' + run: meson setup -D python=enabled -D yaml=enabled -D tests=false build + + - name: Build (Meson) + if: matrix.build == 'meson' + run: meson compile -C build + build-windows: runs-on: windows-latest strategy: diff --git a/Makefile b/Makefile index 4b8909a..9110d17 100644 --- a/Makefile +++ b/Makefile @@ -153,6 +153,11 @@ include Makefile.convert-dtsv0 include Makefile.dtc include Makefile.utils +# Flex-generated source triggers -Wsign-compare in its templates +dtc-lexer.lex.o: CFLAGS += -Wno-sign-compare +convert-dtsv0-lexer.lex.o: CFLAGS += -Wno-sign-compare + + BIN += convert-dtsv0 BIN += dtc BIN += fdtdump