Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
71daecf65This file is pinned to the selected release. Download the original to open it in your design tool.
name: Build Stack-chan Firmware
on:
push:
branches:
- develop
paths:
- "firmware/**"
- "web/**"
- "docs/specs/**"
- "docs/operations/visual-programming-validation.md"
- "docs/operations/visual-programming-acceptance.md"
- ".github/actions/setup/action.yml"
- ".github/workflows/build.yml"
- "lefthook.yml"
pull_request:
branches:
- develop
paths:
- "firmware/**"
- "web/**"
- "docs/specs/**"
- "docs/operations/visual-programming-validation.md"
- "docs/operations/visual-programming-acceptance.md"
- ".github/actions/setup/action.yml"
- ".github/workflows/build.yml"
- "lefthook.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
biome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Run Biome
working-directory: ./firmware
run: npx biome ci . --error-on-warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Run firmware tests
working-directory: ./firmware
run: npm run test
- name: Run legacy name checks
working-directory: ./firmware
run: npm run check:legacy-names
- name: Run architecture checks
working-directory: ./firmware
run: npm run check:architecture
- name: Run manifest preflight
working-directory: ./firmware
run: source "$HOME/.local/share/xs-dev-export.sh" && npm run check:manifest
- name: Run Moddable module tests
working-directory: ./firmware
run: source "$HOME/.local/share/xs-dev-export.sh" && npm run test:moddable
- name: Smoke test Linux simulator startup
working-directory: ./firmware
run: source "$HOME/.local/share/xs-dev-export.sh" && npm run smoke:lin
- name: Run web tool tests
working-directory: ./firmware
run: npm --prefix ../web test && npm --prefix ../web run check:editor-artifacts
web-visual:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
with:
target-branch: "8.3.1"
install-emscripten: "true"
- name: Install web test dependencies
working-directory: ./firmware
run: npm --prefix ../web ci
- name: Audit web dependencies
working-directory: ./firmware
run: npm --prefix ../web audit --audit-level=high
- name: Build WebAssembly simulator
working-directory: ./firmware
run: source "$HOME/.local/share/xs-dev-export.sh" && npm run build:wasm
- name: Run responsive and editor browser tests
working-directory: ./firmware
run: npm --prefix ../web run test:visual
- name: Upload browser screenshots
if: always()
uses: actions/upload-artifact@v7
with:
name: web-visual-screenshots
path: /tmp/stackchan-*.png
if-no-files-found: ignore
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: m5stack
command: npm run build:m5stack
- name: m5stack_cores3
command: npm run build:m5stack_cores3
- name: m5stackchan_cores3
command: npm run build:m5stackchan_cores3
- name: stackchan_rt
command: npm run build:stackchan_rt
- name: takao_core2_sg90
command: npm run build:takao_core2_sg90
- name: wasm
command: npm run build:wasm
- name: editor-tools
command: npm run build:editor-tools
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
with:
target-branch: ${{ (matrix.name == 'wasm' || matrix.name == 'editor-tools') && '8.3.1' || '' }}
install-emscripten: ${{ (matrix.name == 'wasm' || matrix.name == 'editor-tools') && 'true' || 'false' }}
- name: Build firmware (${{ matrix.name }})
working-directory: ./firmware
run: source "$HOME/.local/share/xs-dev-export.sh" && ${{ matrix.command }}
- name: Verify reproducible editor tools
if: matrix.name == 'editor-tools'
working-directory: ./firmware
run: git diff --exit-code -- ':(top)web/editor/vendor/tools.js' ':(top)web/editor/vendor/tools.wasm'