Skip to content

Commit 56c614a

Browse files
committed
fix(ci): add WASM asset verification before CLI build in SEA workflow
The SEA build was failing because CLI build requires Yoga Layout WASM, but the workflow wasn't verifying WASM assets were actually restored from cache before attempting CLI build. Issue: - WASM caches restore successfully (actions/cache/restore) - Verification steps report "valid=true" - But actual files might not be present due to cache corruption/issues - CLI build fails: "ENOENT: no such file or directory, open yoga.wasm" Fix: - Add pre-flight check before CLI build step - Verify yoga.wasm exists before proceeding - Fail fast with clear error if WASM assets missing - Directs user to run build-wasm.yml to prime cache This provides better diagnostics and prevents wasted build time.
1 parent 89353f8 commit 56c614a

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/build-sea.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,28 @@ jobs:
368368
key: node-sea-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.sea-cache-key.outputs.hash }}
369369
restore-keys: node-sea-${{ matrix.platform }}-${{ matrix.arch }}-
370370

371+
- name: Verify WASM assets before CLI build
372+
if: steps.sea-cache.outputs.cache-hit != 'true' || inputs.force
373+
shell: bash
374+
run: |
375+
echo "=== Checking WASM asset availability ==="
376+
echo "Yoga Layout:"
377+
ls -lh packages/yoga-layout/build/wasm/ 2>/dev/null || echo " ❌ Directory not found"
378+
echo ""
379+
echo "AI Models:"
380+
ls -lh packages/socketbin-cli-ai/dist/ 2>/dev/null || echo " ❌ Directory not found"
381+
echo ""
382+
echo "ONNX Runtime:"
383+
ls -lh packages/onnx-runtime-builder/dist/ 2>/dev/null || echo " ❌ Directory not found"
384+
echo ""
385+
386+
# Fail fast if critical Yoga Layout WASM is missing
387+
if [ ! -f "packages/yoga-layout/build/wasm/yoga.wasm" ]; then
388+
echo "::error::Yoga Layout WASM not found! Run build-wasm.yml workflow to prime cache."
389+
echo "Cache status was: yoga=${{ steps.yoga-cache-valid.outputs.valid }}"
390+
exit 1
391+
fi
392+
371393
- name: Build CLI (required for SEA)
372394
if: steps.sea-cache.outputs.cache-hit != 'true' || inputs.force
373395
run: pnpm --filter @socketsecurity/cli run build

0 commit comments

Comments
 (0)