dtc/.github/workflows/build.yml
David Gibson 6c1426dfa9 ci: Add macOS support to install-deps.sh
Use brew install --quiet to suppress warnings about already-installed
packages on the GitHub Actions runner.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2026-06-13 15:48:54 +10:00

216 lines
4.6 KiB
YAML

---
name: Build test
'on':
push:
branches:
- main
- ci
pull_request:
branches:
- main
permissions:
contents: read
# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel
# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-make:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ "alpine", "archlinux", "fedora", "ubuntu" ]
container:
image: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Dependencies
run: |
./scripts/install-deps.sh
- name: Build
run: |
make
- name: Run check
run: |
make check
build-meson:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ "alpine", "archlinux", "fedora", "ubuntu" ]
container:
image: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Dependencies
run: |
./scripts/install-deps.sh
- name: Setup
run: meson setup -D python=enabled -D yaml=enabled build
- name: Build
run: meson compile -C build
- 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@v6
with:
fetch-depth: 0
- name: Install Dependencies
run: |
./scripts/install-deps.sh
- 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:
fail-fast: false
matrix:
include:
- { sys: mingw32, swig: false }
- { sys: mingw64, swig: true }
- { sys: ucrt64, swig: true }
- { sys: clang64, swig: true }
name: ${{ matrix.sys }}
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
flex
bison
pacboy: >-
toolchain:p
meson:p
ninja:p
libyaml:p
${{ matrix.swig && 'swig:p python-setuptools-scm:p' || '' }}
- name: '🚧 Build'
run: |
meson setup -Dtools=true -Dtests=false build
meson compile -C build
build-freebsd-make:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ "13.5", "14.3" ]
name: FreeBSD ${{ matrix.version }} make build
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Start VM
uses: cross-platform-actions/action@v1
with:
operating_system: freebsd
version: ${{ matrix.version }}
shell: sh
- name: Install Dependencies
shell: cpa.sh {0}
run: sudo ./scripts/install-deps.sh
- name: Build
shell: cpa.sh {0}
run: gmake
- name: Run check
shell: cpa.sh {0}
run: gmake check
build-freebsd-meson:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ "13.5", "14.3" ]
name: FreeBSD ${{ matrix.version }} meson build
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Start VM
uses: cross-platform-actions/action@v1
with:
operating_system: freebsd
version: ${{ matrix.version }}
shell: sh
- name: Install Dependencies
shell: cpa.sh {0}
run: sudo ./scripts/install-deps.sh
- name: Setup
shell: cpa.sh {0}
run: meson setup -D python=enabled -D yaml=enabled build
- name: Build
shell: cpa.sh {0}
run: meson compile -C build
- name: Run check
shell: cpa.sh {0}
run: if ! meson test -C build; then cat build/meson-logs/testlog.txt; false; fi