Skip to content

ci(web): publish the web simulator to Cloudflare Workers - #7964

Merged
raphaelcoeffic merged 5 commits into
mainfrom
ci-web-simulator-workers
Nov 1, 2026
Merged

raphaelcoeffic merged 5 commits into
mainfrom
ci-web-simulator-workers

Conversation

@raphaelcoeffic

@raphaelcoeffic raphaelcoeffic commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary of changes:

The online web simulator is uploaded by hand and is out of date: only 6 of the 38 radios it lists have a module. This builds every module each night and deploys main automatically.

  • Shared module build: Companion's module job moves to a reusable workflow, wasm_modules.yml, which both Companion and the new web_simulator.yml call.
  • Targets from fw.json: the hand-kept matrix is gone. This also adds the T18 H7 module, which was missing from Companion's matrix. Companion now runs when fw.json changes, since adding a radio no longer touches companion.yml.
  • Cloudflare Workers: the site moves from Pages to a Worker with static assets, configured in web/wrangler.jsonc.
  • Nightly deploy: the build fails if a radio has no module, and web/scripts/check-deployment.js checks the live site after each deploy. PRs touching web/** only get a build check.
  • Aux serial imports: the page now provides the simuAuxSerial* imports added in fix(simulator): restore host serial port bridge in WASM simulator #7284 as no-ops. Without them, 25 of the 47 radios fail to start with "function import requires a callable".
  • Smoke test: web/scripts/smoke-test.js starts every radio in Chromium before deploying. Each must get past its splash screen without page errors, or the deploy job does not run.
  • Default radio: TX16S instead of the first in the list.
  • Build info: the header of deployed builds shows the commit and build date.

Linux runners

The second commit moves the module builds from macOS to Linux. The Free plan allows 5 concurrent macOS jobs, so in a recent Companion run the 9 module groups took about 25 minutes, with the last ones starting about 13 minutes late. Linux allows 20 concurrent jobs and has 4 cores instead of 3.

The Linux build passed in this PR's Companion run. It used more runner time than macOS (163 against 93 runner-minutes, and 28 against 25 minutes wall time in the runs I measured), so that commit can still be dropped on its own.

Deployment security

The deploy job runs apart from the build, in the web-simulator environment, which only accepts main. The Cloudflare token is only set on the wrangler step, and is limited to this one Worker. PRs and other branches can't reach it.

Testing

  • The site was deployed by hand to create the Worker: https://edgetx-simulator.edgetx.workers.dev. check-deployment.js passes there for all 47 radios. The version deployed there fails on 25 of the 47 radios, because of the missing aux serial imports.
  • actionlint reports nothing on the new workflows, apart from missing metadata in existing actions.
  • The deploy job and the token worked in a test run from this branch, using a temporary trigger and environment rule, both since removed. Not tested yet: the schedule and workflow_dispatch, which need the workflow on main.
  • The smoke test passes on all 47 radios locally, in about 2.5 minutes, using the deployed modules. With the imports removed, it fails on TX16S and Boxer with the error above. TX16S and Boxer also reach "Running" in Firefox, in a separate one-off check. Its CI step has not run on a Linux runner yet.

After merging

  • Start the Web Simulator workflow by hand, to replace the broken deployed version without waiting for the nightly run.
  • Decide on a custom domain, then redirect edgetx-simulator.pages.dev to the final URL.

Build all WASM modules every night and deploy main as a Worker with static
assets, replacing the manual upload to Cloudflare Pages.

Move the module build into a reusable workflow shared with Companion. Its
targets now come from fw.json, which adds the T18 H7 module that was missing
from the Companion matrix.

The deploy job runs separately from the build, in a GitHub environment
limited to main, so that the Cloudflare token is only exposed to wrangler.
GitHub allows 5 concurrent macOS jobs on the Free plan, shared with the macOS
Companion build. With 9 module groups, the last ones wait for a free runner.
Linux runners have 4 cores instead of 3, and a limit of 20 concurrent jobs.
Modules of radios with an aux serial port import simuAuxSerial* since #7284,
and could not be instantiated by the page: 25 of the 47 radios failed to start
with "function import requires a callable".
Only for visitors without a previous selection or a radio in the URL.
Checking that the modules are served did not notice that most of them could not
start. Each radio now has to get past its splash screen without page errors, or
the deploy job does not run.
@raphaelcoeffic
raphaelcoeffic merged commit d3981ad into main Nov 1, 2026
19 checks passed
@raphaelcoeffic
raphaelcoeffic deleted the ci-web-simulator-workers branch November 1, 2026 12:18
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