Files
Nitro-V3/.github/workflows/ci.yml
T
medievalshell 7a65e5bf6d feat: soundboard (room-scoped custom audio pads)
Client side of the soundboard. Room owners enable it in Room Settings >
Misc (next to the YouTube TV toggle). When enabled, a soundboard icon
appears in the toolbar for everyone in the room; pressing a pad broadcasts
the sound so all occupants hear it. Incoming SoundboardPlay is played via
the HTML5 Audio API.

Also: fix FloorplanCanvasSVG to use ReactElement instead of the removed
global JSX namespace (React 19), and pair the client Dev branch with the
renderer fork that carries the custom features in CI.

How sounds are managed (works with any CMS):
Sounds are rows in the `soundboard_sounds` table:
    id, name, url, enabled, sort_order
The emulator loads every row with enabled=1 (ordered by sort_order, id)
and sends the list to clients on room enter; the client plays `url`
directly, so any publicly reachable audio URL works (mp3/ogg/wav).

To add a sound from an admin/housekeeping panel of any CMS:
  1. Upload the audio file to wherever the CMS stores public assets
     (same approach as custom badge images).
  2. INSERT a row into `soundboard_sounds` with the display name and the
     public URL of the uploaded file, enabled = 1.
  3. Reload the emulator soundboard (or restart) to pick it up.
Relative urls resolve against the `soundboard.url.prefix` config key
(falls back to `asset.url`); absolute urls are used as-is.
2026-05-28 09:04:17 +02:00

181 lines
7.1 KiB
YAML

name: CI
on:
push:
branches:
- main
- Dev
- 'feat/**'
pull_request:
workflow_dispatch:
inputs:
renderer_repo:
description: 'Renderer repo (owner/name). Empty = auto from client branch.'
required: false
default: ''
renderer_ref:
description: 'Renderer git ref. Empty = auto from client branch.'
required: false
default: ''
# Opt into the Node.js 24 runtime for the JavaScript actions
# (actions/checkout, actions/setup-node, …). Node 20 will be removed
# from GitHub-hosted runners in September 2026; this env var asks the
# runner to use Node 24 today so the workflow logs stop warning about
# it on every run.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
check:
name: Type check + tests
runs-on: ubuntu-latest
steps:
# The build/dev/typecheck setup expects the Nitro renderer SDK to
# live as a sibling of this repo (see CLAUDE.md → Setup walkthrough).
# Mirror that here by checking the client into <workspace>/Nitro-V3
# and the renderer into <workspace>/Nitro_Render_V3.
- name: Checkout Nitro-V3
uses: actions/checkout@v4
with:
path: Nitro-V3
# Pick the renderer ref dynamically based on the client context.
# The two repos must stay wire-aligned (composer/parser
# signatures); pairing `main` with a stale branch is what
# produced the "Expected 14-15 arguments, but got 16" failure on
# the catalog edit composer.
#
# This branch (`feat/housekeeping-panel`) references HK composers
# /events that live on the renderer PR branch
# (simoleo89/Nitro_Render_V3 @ feat/housekeeping-packets) — they
# haven't been merged upstream yet. Pair against the fork branch
# for this PR so the typecheck step can resolve the imports;
# once the renderer PR lands on duckietm:Dev this whole
# special-case block can be dropped.
#
# Mapping:
# client `main` → duckietm/Nitro_Render_V3 @ main
# client `feat/housekeeping-panel` → simoleo89/Nitro_Render_V3 @ feat/housekeeping-packets
# client `feat/**` (other) → duckietm/Nitro_Render_V3 @ Dev
# PR base `main` → duckietm/Nitro_Render_V3 @ main
# PR head `feat/housekeeping-panel` → simoleo89/Nitro_Render_V3 @ feat/housekeeping-packets
# PR base `Dev` (upstream) → duckietm/Nitro_Render_V3 @ Dev
# PR base `feat/**` → duckietm/Nitro_Render_V3 @ Dev
#
# Override via workflow_dispatch inputs when you need an ad-hoc
# pairing.
- name: Resolve renderer ref
id: renderer
run: |
REPO="${{ github.event.inputs.renderer_repo }}"
REF="${{ github.event.inputs.renderer_ref }}"
if [ -z "$REPO" ] || [ -z "$REF" ]; then
# For PRs we usually pair against the base ref, but the HK
# PR specifically needs to pair against its OWN head ref —
# the renderer companion PR is named identically
# (`feat/housekeeping-packets`) and lives on the same fork.
case "${GITHUB_EVENT_NAME}" in
pull_request)
if [ "${GITHUB_HEAD_REF}" = "feat/housekeeping-panel" ]; then
CTX="${GITHUB_HEAD_REF}"
else
CTX="${GITHUB_BASE_REF}"
fi
;;
*)
CTX="${GITHUB_REF_NAME}"
;;
esac
case "$CTX" in
main)
AUTO_REPO="duckietm/Nitro_Render_V3"
AUTO_REF="main"
;;
Dev)
# The client `Dev` branch carries the custom features
# (rare values, fortune wheel, soundboard); they live on
# the matching renderer fork branch, not upstream.
AUTO_REPO="medievalshell/Nitro_Render_V3"
AUTO_REF="dev"
;;
feat/housekeeping-panel)
AUTO_REPO="simoleo89/Nitro_Render_V3"
AUTO_REF="feat/housekeeping-packets"
;;
*)
AUTO_REPO="duckietm/Nitro_Render_V3"
AUTO_REF="Dev"
;;
esac
[ -z "$REPO" ] && REPO="$AUTO_REPO"
[ -z "$REF" ] && REF="$AUTO_REF"
fi
echo "repo=$REPO" >> "$GITHUB_OUTPUT"
echo "ref=$REF" >> "$GITHUB_OUTPUT"
echo "Resolved renderer pairing: $REPO @ $REF (client ctx: ${GITHUB_BASE_REF:-$GITHUB_REF_NAME}, event: ${GITHUB_EVENT_NAME})"
- name: Checkout Nitro_Render_V3 (sibling)
uses: actions/checkout@v4
with:
repository: ${{ steps.renderer.outputs.repo }}
ref: ${{ steps.renderer.outputs.ref }}
path: Nitro_Render_V3
- name: Setup Node 22
uses: actions/setup-node@v4
with:
node-version: '22'
cache: yarn
cache-dependency-path: |
Nitro-V3/yarn.lock
Nitro_Render_V3/yarn.lock
- name: Install renderer SDK deps
working-directory: Nitro_Render_V3
run: yarn install --frozen-lockfile
- name: Install client deps
working-directory: Nitro-V3
run: yarn install --frozen-lockfile
# The renderer SDK is consumed via a filesystem symlink in
# node_modules/@nitrots/nitro-renderer; create it AFTER yarn
# install (otherwise yarn would clean it up since the package
# isn't declared in package.json). tsgo (TS 7 native preview)
# then resolves the tsconfig `include` entry pointing at the
# renderer's `src/**/*.ts`.
#
# Use an absolute path so the link target is unambiguous
# regardless of the cwd that reads it. A relative target like
# `../../../Nitro_Render_V3` resolves to
# `Nitro-V3/Nitro_Render_V3` (one too few `..`), which doesn't
# exist and makes tsgo report TS2307 across the entire src/.
- name: Symlink renderer into client node_modules
run: |
mkdir -p Nitro-V3/node_modules/@nitrots
ln -sfn "${{ github.workspace }}/Nitro_Render_V3" Nitro-V3/node_modules/@nitrots/nitro-renderer
ls -la Nitro-V3/node_modules/@nitrots/
ls Nitro-V3/node_modules/@nitrots/nitro-renderer/packages/api/src/ | head -5
- name: Type check (tsgo)
working-directory: Nitro-V3
run: yarn typecheck
# Hook-order lint gate — the full yarn eslint emits ~900 pre-existing
# baseline errors (brace style, indentation), so we use a focused
# config that asserts only react-hooks/rules-of-hooks. Catches the
# "hook below early-return" pattern that produced two production
# crashes this session (CatalogPurchaseWidgetView, CatalogItemGridWidgetView).
- name: ESLint (hook-order gate)
working-directory: Nitro-V3
run: yarn lint:hooks
- name: Vitest
working-directory: Nitro-V3
run: yarn test --run