fix(mobile): the platform builds are broken on main, and nothing was watching (#4746)

`mobile-platforms.yml` fails at `npm ci` on `main`, in ~2 seconds, on both
runners. Every step it exists for -- the simulator app, the debug APK, and
both "is the Rust inside it?" guards -- is skipped.

Two independent defects, and the second is what let the first land.

1. Neither job builds the `file:` dependency.

   #4727 made `praisonai` a `file:` link to the sibling package, so `npm ci`
   in praisonai-mobile now runs praisonai-ts's own `prepare` -> `prebuild` ->
   `rimraf dist`. `rimraf` is a praisonai-ts devDependency and a fresh runner
   has no praisonai-ts `node_modules`, so:

       npm error code 127
       npm error command sh -c npm run build
       npm error sh: rimraf: command not found

   `mobile.yml` gives all four of its jobs a "Build praisonai-ts" step and so
   survives. These two jobs were written against the tree from before the
   dependency existed and never got it.

   Reproduced locally from a clean state (both node_modules and dist removed):
   `npm ci` exits 127. With the new step ahead of it -- praisonai-ts
   `npm install --legacy-peer-deps` then `npm run build` -- the same command
   from the same state exits 0.

2. The workflow had no `push` trigger, so it had never run on `main` at all.

   That is why this was invisible. #4737 branched from `28ab7f1cb`, which
   predates #4727; `git merge-base --is-ancestor 6885c1276 9ea153d65` returns
   1. Its platform run was genuinely green -- iOS 3m13s, Android 3m -- but
   green on a tree where `dependencies` was empty and `prepare` therefore
   never fired. Two PRs, each correct alone, broke `main` the moment both had
   landed, and no gate on `main` was looking.

   `push: branches: [main]` now closes that, sharing the paths filter through
   a YAML anchor so the two cannot drift apart. The filter also gains
   `src/praisonai-ts/src/**`, since that is the side of the `file:` link that
   drifts.

A gate that quietly does not run is worse than one that fails, and this is
the third instance in this package: a path filter blind to praisonai-ts, an
unquoted `file:` in a step name that made GitHub skip an entire workflow, and
now a workflow with no trigger on the branch it was meant to protect.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Mervin PraisonandClaude Opus 5 authored and GitHub committed 2026-09-03 08:44:10 +01:00
1 parent fd6fd42f45
commit fa7caf7755
1 file changed
+34 -1
+34 -1
View File
@@ -38,9 +38,18 @@ name: mobile platforms
on:
workflow_dispatch:
pull_request:
paths:
paths: &watched
- 'src/praisonai-mobile/**'
- 'src/praisonai-ts/src/**'
- '.github/workflows/mobile-platforms.yml'
# Without this, no platform build had ever run on main -- so a break
# introduced by two PRs that were each green apart could sit on main
# unnoticed. That is exactly what happened: #4737 branched from before
# #4727 added the `file:` dependency, so the two were never installed
# together until they had both landed.
push:
branches: [main]
paths: *watched
concurrency:
group: mobile-platforms-${{ github.ref }}
@@ -72,6 +81,18 @@ jobs:
with:
workspaces: src/praisonai-mobile/src-tauri
key: ios-sim
- name: "Build praisonai-ts (the file: dependency)"
# praisonai-mobile depends on praisonai by `file:`, so `npm ci`
# here runs praisonai-ts's own `prepare` -> `rimraf dist`. On a
# fresh runner praisonai-ts has no node_modules, so rimraf is not
# installed and `npm ci` dies with code 127 before a single
# platform step runs. mobile.yml gives all four of its jobs this
# step; these two were written against the tree from before the
# dependency existed and never got it.
working-directory: src/praisonai-ts
run: |
npm install --no-audit --no-fund --legacy-peer-deps
npm run build
- run: npm ci
- name: Generate the Xcode project (only if gen/apple is not committed)
@@ -255,6 +276,18 @@ jobs:
with:
workspaces: src/praisonai-mobile/src-tauri
key: android-apk
- name: "Build praisonai-ts (the file: dependency)"
# praisonai-mobile depends on praisonai by `file:`, so `npm ci`
# here runs praisonai-ts's own `prepare` -> `rimraf dist`. On a
# fresh runner praisonai-ts has no node_modules, so rimraf is not
# installed and `npm ci` dies with code 127 before a single
# platform step runs. mobile.yml gives all four of its jobs this
# step; these two were written against the tree from before the
# dependency existed and never got it.
working-directory: src/praisonai-ts
run: |
npm install --no-audit --no-fund --legacy-peer-deps
npm run build
- run: npm ci
- name: Generate the Android project (only if gen/android is not committed)