Skip to content

fix(ci): build the intended targets in the firmware build matrix - #504

Merged
meganetaaan merged 1 commit into
developfrom
fix/ci-build-targets
Jul 7, 2026
Merged

fix(ci): build the intended targets in the firmware build matrix#504
meganetaaan merged 1 commit into
developfrom
fix/ci-build-targets

Conversation

@meganetaaan

@meganetaaan meganetaaan commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

CIのbuildマトリクスのうち m5stack / m5stack_cores3 レグが npm run build --target=esp32/... を使っていましたが、npm は --target を argv ではなく npm_config_target 環境変数に変換し、scripts/firmware.mjs はこれを参照しないため、両レグともデフォルトの m5stackchan_cores3 に沈黙フォールバックしていました(素のm5stack系はCIで一度もビルドされておらず、m5stackchan_cores3 が3回ビルドされていた)。

  • build:m5stack / build:m5stack_cores3 スクリプトを追加(リアーキ前のbuildと同じく manifest_local.json を mcconfig 直接呼び出しでビルド)
  • CIマトリクスを名前付きスクリプトに変更し、欠落していた takao_core2_sg90 レグを追加
  • firmware.mjsnpm_config_target 検知ガードを追加し、--target= 形式を沈黙フォールバックではなくエラーにする

Release impact

none

CI設定と開発用ビルドラッパのみの変更で、出荷ファームウェアのコードには影響しません。リリースノート・changesetは不要です。

Validation

  • source ~/.local/share/xs-dev-export.sh && npm run build:m5stack → OK
  • source ~/.local/share/xs-dev-export.sh && npm run build:m5stack_cores3 → OK
  • npm run build --target=esp32/m5stack → 新ガードによりエラーメッセージを出して失敗することを確認
  • STACKCHAN_DRY_RUN=1 npm run build → 既存のデフォルトビルド(m5stackchan_cores3)が従来どおり動作
  • npx biome check scripts/firmware.mjs package.json → OK

takao_core2_sg90 レグは本PRのCI実行で初回検証されます。

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for additional firmware build targets, including a new target for the Takao Core2 SG90 and updated M5Stack build commands.
  • Bug Fixes

    • Improved handling of unsupported build target arguments so the build process now stops with a clear message instead of falling back to the wrong device.
    • Updated automated build jobs to use the correct per-target build steps for firmware variants.

The m5stack / m5stack_cores3 legs used `npm run build --target=...`,
but npm turns `--target` into the npm_config_target env var, which
scripts/firmware.mjs never reads. Both legs silently fell back to the
default m5stackchan_cores3 device, so the plain m5stack targets were
never actually built in CI.

- Add build:m5stack / build:m5stack_cores3 scripts that call mcconfig
  directly, matching the pre-rearchitecture build behavior
- Point the CI matrix at the named scripts and add the missing
  takao_core2_sg90 leg
- Make firmware.mjs fail loudly when npm_config_target is set instead
  of silently building the default device

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2f22813d-ead0-47da-8702-557842c6205b

📥 Commits

Reviewing files that changed from the base of the PR and between ab08b32 and cb3902e.

📒 Files selected for processing (3)
  • .github/workflows/build.yml
  • firmware/package.json
  • firmware/scripts/firmware.mjs

📝 Walkthrough

Walkthrough

Adds two new npm build scripts for m5stack platforms in firmware/package.json, updates the CI build matrix to use the dedicated m5stack script and adds a takao_core2_sg90 target, and adds an environment-variable guard in firmware.mjs that rejects the unsupported --target flag.

Changes

Build script and CI wiring

Layer / File(s) Summary
Add m5stack build scripts
firmware/package.json
Adds build:m5stack and build:m5stack_cores3 npm scripts that run mcconfig against the corresponding esp32 targets using host/app/manifest_local.json.
Wire CI matrix to dedicated scripts and new target
.github/workflows/build.yml
Switches the m5stack matrix entry to npm run build:m5stack and adds a new takao_core2_sg90 matrix entry running npm run build:takao_core2_sg90.
Guard against unsupported --target flag
firmware/scripts/firmware.mjs
Checks process.env.npm_config_target; if set, logs an error and exits with status 1 instead of falling back to a default device.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: stc1988

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing the firmware CI build matrix to build the intended targets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-build-targets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@meganetaaan
meganetaaan merged commit de86652 into develop Jul 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant