mirror of
https://github.com/D-Modem/hardware.git
synced 2026-11-28 17:48:05 -08:00
Package installs sometimes stall on GitHub's runners. A local action (.github/actions/apt, and .github/actions/brew where macOS builds) caches the downloaded packages, and apt's package lists with them, keyed on the runner image and the package list. A cache hit installs offline; a miss installs as before, with retries and timeouts, and saves the cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRUAp3wTZAV7UCEiC4S
86 lines
3.0 KiB
YAML
86 lines
3.0 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/**"]
|
|
pull_request:
|
|
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml", ".github/actions/apt/**"]
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# (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: 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@v4
|
|
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@v4
|
|
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
|