Files
hardware/.github/workflows/firmware.yml
T
NeoandClaude dc1c24e3f4 Add the site, with a protocol reference made from the headers (#10)
firmware/tools/protocol_ref.py writes docs/protocol-reference.md from
protocol.h, line_proto.h and wb_proto.h: every request, constant and
enum, and each wire struct's fields with their offsets and sizes (checked
against the headers' _Static_asserts). The firmware workflow and the new
Pages workflow fail if the page is out of date.

The site is docs/, the README, the specs and the firmware, hardware,
enclosure and net list pages (extra.site_include), on brand's theme.


Claude-Session: https://claude.ai/code/session_01B82eRSqjp9Pn2KBr9N9LAn

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-05 18:01:00 -08:00

89 lines
3.2 KiB
YAML

# SPDX-License-Identifier: AGPL-3.0-only
# Copyright (C) 2026 D-Modem Authors
name: firmware
on:
push:
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml", ".github/actions/apt/**", "!firmware/**/*.md"]
pull_request:
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml", ".github/actions/apt/**", "!firmware/**/*.md"]
jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
# (apt's downloads cached: .github/actions/apt)
- name: Tools
uses: ./.github/actions/apt
with:
packages: >-
gcc-arm-none-eabi libnewlib-arm-none-eabi
libstdc++-arm-none-eabi-newlib ninja-build cmake
recommends: 'true'
- name: Pin header matches the netlist
run: |
python3 hardware/netlist/build_netlist.py
git diff --exit-code -- firmware/src/generated hardware/netlist
- name: Every function is documented
run: python3 firmware/tools/check_docs.py
- name: Protocol reference matches the headers
run: python3 firmware/tools/protocol_ref.py --check
- name: Core tests (host)
run: make -C firmware/test run
- name: Build (hood board)
run: |
cmake -S firmware -B firmware/build-hood -G Ninja -DPS_BOARD=hood
ninja -C firmware/build-hood
- name: Build (W board, Bluetooth)
run: |
cmake -S firmware -B firmware/build-w -G Ninja -DPS_BOARD=w \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-w
- name: Build (Pico bench rig)
run: |
cmake -S firmware -B firmware/build-pico -G Ninja -DPS_BOARD=pico \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-pico
- name: Build (phone-line stick)
run: |
cmake -S firmware -B firmware/build-line -G Ninja -DPS_BOARD=line \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-line
- name: Build (wideband stick)
run: |
cmake -S firmware -B firmware/build-wb -G Ninja -DPS_BOARD=wb \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-wb
- uses: actions/setup-node@v6
with:
node-version: 22
- name: Emulator test (rp2040js)
run: firmware/test/emu/run.sh firmware/build-hood/pico-serial-hood.bin
- uses: actions/upload-artifact@v7
with:
name: pico-serial-firmware
path: |
firmware/build-hood/pico-serial-hood.uf2
firmware/build-w/pico-serial-w.uf2
firmware/build-pico/pico-serial-pico.uf2
firmware/build-line/pico-serial-line.uf2
firmware/build-wb/pico-serial-wb.uf2