Skip to content

Commit f7624d9

Browse files
committed
fix(ci): pass --force flag to WASM build scripts when force rebuild requested
The workflow's inputs.force parameter was being checked to conditionally run builds, but the --force flag wasn't being passed through to the actual build scripts. This caused checkpoint-based builders (Yoga Layout, AI models, ONNX Runtime) to skip steps even when force rebuild was requested. Changes: - build-wasm.yml: Add conditional --force flag to all three WASM builders - build-sea.yml: Add conditional --force flag to embedded WASM builds Now when workflows are run with "Force rebuild (ignore cache)" option: - Yoga Layout build receives --force, ignores checkpoint files - AI models build receives --force, rebuilds from scratch - ONNX Runtime build receives --force, ignores checkpoint files This ensures force rebuilds actually rebuild everything from source.
1 parent bfb0231 commit f7624d9

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

.github/workflows/build-sea.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,31 @@ jobs:
213213
# Build missing WASM assets.
214214
if [ "${{ steps.yoga-cache-valid.outputs.valid }}" != "true" ]; then
215215
echo "::group::Building Yoga Layout WASM"
216-
pnpm --filter @socketsecurity/yoga-layout run build
216+
if [ "${{ inputs.force }}" = "true" ]; then
217+
pnpm --filter @socketsecurity/yoga-layout run build -- --force
218+
else
219+
pnpm --filter @socketsecurity/yoga-layout run build
220+
fi
217221
echo "::endgroup::"
218222
fi
219223
220224
if [ "${{ steps.ai-cache-valid.outputs.valid }}" != "true" ]; then
221225
echo "::group::Building AI models (10-15 minutes)"
222-
pnpm --filter @socketbin/cli-ai run build
226+
if [ "${{ inputs.force }}" = "true" ]; then
227+
pnpm --filter @socketbin/cli-ai run build -- --force
228+
else
229+
pnpm --filter @socketbin/cli-ai run build
230+
fi
223231
echo "::endgroup::"
224232
fi
225233
226234
if [ "${{ steps.onnx-cache-valid.outputs.valid }}" != "true" ]; then
227235
echo "::group::Building ONNX Runtime (20-30 minutes)"
228-
pnpm --filter @socketsecurity/onnx-runtime-builder run build
236+
if [ "${{ inputs.force }}" = "true" ]; then
237+
pnpm --filter @socketsecurity/onnx-runtime-builder run build -- --force
238+
else
239+
pnpm --filter @socketsecurity/onnx-runtime-builder run build
240+
fi
229241
echo "::endgroup::"
230242
fi
231243

.github/workflows/build-wasm.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ jobs:
9999
run: |
100100
echo "::group::Building Yoga Layout WASM"
101101
source emsdk/emsdk_env.sh
102-
pnpm --filter @socketsecurity/yoga-layout run build
102+
if [ "${{ inputs.force }}" = "true" ]; then
103+
pnpm --filter @socketsecurity/yoga-layout run build -- --force
104+
else
105+
pnpm --filter @socketsecurity/yoga-layout run build
106+
fi
103107
echo "Build exit code: $?"
104108
echo "Checking for build artifacts..."
105109
ls -lh packages/yoga-layout/build/wasm/ || echo "wasm directory not found"
@@ -191,7 +195,11 @@ jobs:
191195
if: steps.ai-cache-valid.outputs.valid != 'true' || inputs.force
192196
run: |
193197
echo "::group::Building AI models (this will take 10-15 minutes)"
194-
pnpm --filter @socketbin/cli-ai run build
198+
if [ "${{ inputs.force }}" = "true" ]; then
199+
pnpm --filter @socketbin/cli-ai run build -- --force
200+
else
201+
pnpm --filter @socketbin/cli-ai run build
202+
fi
195203
echo "Build exit code: $?"
196204
echo "Checking for build artifacts..."
197205
ls -lh packages/socketbin-cli-ai/dist/ || echo "dist directory not found"
@@ -289,7 +297,11 @@ jobs:
289297
run: |
290298
echo "::group::Building ONNX Runtime WASM (this will take 20-30 minutes)"
291299
source emsdk/emsdk_env.sh
292-
pnpm --filter @socketsecurity/onnx-runtime-builder run build
300+
if [ "${{ inputs.force }}" = "true" ]; then
301+
pnpm --filter @socketsecurity/onnx-runtime-builder run build -- --force
302+
else
303+
pnpm --filter @socketsecurity/onnx-runtime-builder run build
304+
fi
293305
echo "Build exit code: $?"
294306
echo "Checking for build artifacts..."
295307
ls -lh packages/onnx-runtime-builder/dist/ || echo "dist directory not found"

0 commit comments

Comments
 (0)