From 09f00dd238cb6f4cf330b3f0eb753a5586d3335c Mon Sep 17 00:00:00 2001 From: James Maes Date: Wed, 13 May 2026 06:55:19 -0500 Subject: [PATCH] ci(actions): fix typecheck/build order + share webview artifact across jobs Three surgical fixes to .github/workflows/ci.yml that came out of the first develop-push validation cycle after PR #154 landed: 1. Webview job: typecheck ran before build, so packages/hud's TS imports of `@jarvis/bus` failed with TS2307 "Cannot find module". Build must produce `packages/bus/dist/index.d.ts` before typecheck reads it. Reordered the steps and switched the build invocation to `bash scripts/build-webview.sh` so the production-stamped output lands at `App/Resources/webview/` (where SPM tests + xcodebuild both look for it). 2. swift-packages job: 6 packages (AgentCore / Bus / Harness / MCP / Voice / VoiceLog) failed with `Error: bus not mounted` because the BusTests + downstream test fixtures mount a real WKWebView that loads `App/Resources/webview/index.html`. CI didn't have that file. Added `needs: [webview]` + an `actions/download-artifact@v4` step that pulls the new `webview-resources` artifact to `App/Resources/webview/`. 3. app-build job: was running `bash scripts/build-webview.sh` inline (which needs pnpm + node setup, another 30-60s of runner time). Replaced with the same `download-artifact` step. The shared artifact is produced once in the webview job and consumed by both swift-packages and app-build. The artifact name changed from `webview-dist` (raw `packages/hud/dist/` contents) to `webview-resources` (the production-stamped `App/Resources/webview/` tree). No external consumers existed for the old artifact name (it was added in #154 in the same PR), so this is a clean rename. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/ci.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c25af49..a4dcad7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,6 +107,7 @@ jobs: swift-packages: name: SPM ${{ matrix.package }} runs-on: macos-15 + needs: [webview] strategy: fail-fast: false matrix: @@ -133,6 +134,16 @@ jobs: run: | swift --version xcodebuild -version + # Download the production webview bundle so Bus + downstream packages + # (AgentCore / Harness / MCP / Voice / VoiceLog) can mount a real + # WKWebView with a working JS bridge. Without this, BusTests fail + # with `Error: bus not mounted` because index.html + the JS bundle + # are missing from App/Resources/webview/. + - name: Download webview resources + uses: actions/download-artifact@v4 + with: + name: webview-resources + path: App/Resources/webview/ - name: Cache SPM build artifacts uses: actions/cache@v4 with: @@ -153,20 +164,14 @@ jobs: - uses: actions/checkout@v4 - name: Select Xcode run: sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer || sudo xcode-select -s /Applications/Xcode.app/Contents/Developer - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.30.2 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "pnpm" - cache-dependency-path: webview/pnpm-lock.yaml - name: Install xcodegen run: brew install xcodegen - - name: Build webview (produces App/Resources/webview/) - run: bash scripts/build-webview.sh + # Reuse the webview build from the upstream job rather than rebuilding. + - name: Download webview resources + uses: actions/download-artifact@v4 + with: + name: webview-resources + path: App/Resources/webview/ - name: check-app-builds.sh run: bash scripts/check-app-builds.sh - name: verify-codesign-settings.sh -- 2.54.0