Files
JIANT/.github/workflows/emulator.yml
T
Claude e47f6bf976 JIANT 0.4 (3): TRIO folded into ANALOG, LOFI BYTE (bytebeat), PHASE FB
- ANALOG: SYNC, RING and SAW3 waves (their own render: the other waves' loop as it
  was); TRIO (engine 6) retired, its sounds load as ANALOG's nearest
  (core.h analog_from_trio: projects, user presets); its presets SYNC LEAD, RING
  BELL, FAT BASS in ANALOG
- LOFI: WAVE BYTE, 32 bytebeat formulas (DUTY: ALGO, CRSH: VAR), t following the
  note; presets BYTEBEAT, BYTE VAR
- PHASE: E8 FB, phase feedback (two-sample mean); presets GROWL, FB BASS
- Pages CI: the package named by the version only; FELUCCA_VERSION v0.4
- Tests: BYTE, the ANALOG waves, PHASE FB, TRIO conversion; goldens (no existing
  render changed; TRIO's gone, 7 new), target budgets

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-10-09 17:12:17 +00:00

80 lines
3.5 KiB
YAML

# SPDX-License-Identifier: GPL-3.0-only
# The browser emulator (web/emu) on GitHub Pages: the firmware's sources compiled to WebAssembly, on every push to
# main. Needs Settings > Pages > Source: "GitHub Actions" once. The emulator needs only the generated headers; the
# installer (webapp/installer) and the editor (webapp/editor) need the package, built with JieLi's toolchain (downloaded).
name: emulator
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: pip install Pillow numpy fonttools
- name: generated headers (fonts, icons, palettes, shapes, tables, samples)
run: python3 -c "import sys; sys.path.insert(0, 'tools'); import build; build.generate()"
- uses: mymindstorm/setup-emsdk@v14
with:
version: 6.0.11 # (the version the emulator is tested with)
- name: the emulator
run: sh web/emu/build.sh
# (JIANT) the installer and the web editor next to the emulator: the package needs JieLi's toolchain (downloaded)
# and three files of their AC79 SDK (a partial clone: only those blobs). If any of it fails the emulator still goes up
- name: JieLi toolchain and SDK files (cached)
uses: actions/cache@v4
with:
path: |
~/.jieli
~/fw-AC79_AIoT_SDK/cpu/wl82/tools
key: jieli-ac79-v1
- name: JieLi toolchain and SDK files
id: tc
continue-on-error: true
run: |
# gitee resets connections from the runners now and then: retries with backoff; the cache above keeps them
retry() { for d in 0 5 15 30 60; do sleep $d; "$@" && return 0; done; return 1; }
T=$HOME/fw-AC79_AIoT_SDK/cpu/wl82/tools
[ -e "$HOME/.jieli/toolchain" ] || retry sh tools/get_toolchain.sh "$HOME/.jieli"
if [ ! -s "$T/uboot.boot" ] || [ ! -s "$T/cfg_tool.bin" ] || [ ! -s "$T/cfg/eq_cfg_hw.bin" ]; then
rm -rf "$HOME/fw-AC79_AIoT_SDK"
retry git clone --filter=blob:none --no-checkout --depth 1 https://gitee.com/Jieli-Tech/fw-AC79_AIoT_SDK.git "$HOME/fw-AC79_AIoT_SDK"
cd "$HOME/fw-AC79_AIoT_SDK" && git sparse-checkout set --no-cone /cpu/wl82/tools/uboot.boot /cpu/wl82/tools/cfg_tool.bin \
/cpu/wl82/tools/cfg/eq_cfg_hw.bin && retry git checkout
fi
test -s "$T/uboot.boot" && test -s "$T/cfg_tool.bin" && test -s "$T/cfg/eq_cfg_hw.bin"
- name: the package, the installer and the editor
if: steps.tc.outcome == 'success'
continue-on-error: true
env:
AC79_SDK: /home/runner/fw-AC79_AIoT_SDK
JIELI_TOOLCHAIN: /home/runner/.jieli/toolchain
run: |
python3 tools/build.py
V=$(sed -n 's/^#define FELUCCA_VERSION "\([^"]*\)".*/\1/p' firmware/src/felucca.c | head -1)
python3 web/make_site.py build/felucca.fwsc "${V:-dev}-${GITHUB_SHA::7}" build/site
cp -r build/site/webapp build/site/firmware build/emu/
- uses: actions/upload-pages-artifact@v3
with:
path: build/emu
deploy:
needs: build
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4