mirror of
https://github.com/dgibson/dtc.git
synced 2026-07-10 13:29:48 -04:00
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 <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1aaa44849b
commit
83cdc93ca9
2 changed files with 36 additions and 0 deletions
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
5
Makefile
5
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue