Skip to content

Commit f434195

Browse files
committed
fix(ci): build all AI models in workflow
Fix workflow to build both MiniLM and CodeT5 models by default. Issue: Workflow was not passing --all flag, so only MiniLM was built by default, but verification expected both MiniLM and CodeT5 files to exist. Changes: - Add --all flag to build command to build both models - Update cached artifacts check to verify all 3 model files exist - Add explicit check for codet5-decoder file in verification step - Add better logging for expected files when cache is invalid This ensures the workflow behavior matches the verification expectations.
1 parent e3d0705 commit f434195

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/build-wasm.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,20 @@ jobs:
258258
id: models-cache-valid
259259
run: |
260260
SUFFIX="${{ steps.models-cache-key.outputs.suffix }}"
261-
if [ -f "packages/models/dist/minilm-l6-${SUFFIX}.onnx" ] && [ -f "packages/models/dist/codet5-encoder-${SUFFIX}.onnx" ]; then
261+
# Check for both MiniLM and CodeT5 models.
262+
if [ -f "packages/models/dist/minilm-l6-${SUFFIX}.onnx" ] && \
263+
[ -f "packages/models/dist/codet5-encoder-${SUFFIX}.onnx" ] && \
264+
[ -f "packages/models/dist/codet5-decoder-${SUFFIX}.onnx" ]; then
262265
echo "valid=true" >> $GITHUB_OUTPUT
263-
echo "Cache hit: artifacts found"
266+
echo "Cache hit: all artifacts found"
264267
ls -lh packages/models/dist/
265268
else
266269
echo "valid=false" >> $GITHUB_OUTPUT
267270
echo "Cache miss or incomplete: forcing rebuild"
271+
echo "Expected files:"
272+
echo " - minilm-l6-${SUFFIX}.onnx"
273+
echo " - codet5-encoder-${SUFFIX}.onnx"
274+
echo " - codet5-decoder-${SUFFIX}.onnx"
268275
ls -lh packages/models/dist/ 2>/dev/null || echo "Directory does not exist"
269276
fi
270277
@@ -274,8 +281,8 @@ jobs:
274281
QUANT_LEVEL="${{ steps.models-cache-key.outputs.quant-level }}"
275282
echo "::group::Building ${QUANT_LEVEL}-quantized AI models"
276283
277-
# Build command with quantization flag.
278-
BUILD_CMD="pnpm --filter @socketsecurity/models run build --"
284+
# Build command with quantization flag and --all for both models.
285+
BUILD_CMD="pnpm --filter @socketsecurity/models run build -- --all"
279286
280287
if [ "$QUANT_LEVEL" = "INT8" ]; then
281288
BUILD_CMD="$BUILD_CMD --int8"
@@ -304,6 +311,12 @@ jobs:
304311
fi
305312
if [ ! -f "packages/models/dist/codet5-encoder-${SUFFIX}.onnx" ]; then
306313
echo "ERROR: codet5-encoder-${SUFFIX}.onnx not found!"
314+
ls -lh packages/models/dist/ || echo "Directory does not exist"
315+
exit 1
316+
fi
317+
if [ ! -f "packages/models/dist/codet5-decoder-${SUFFIX}.onnx" ]; then
318+
echo "ERROR: codet5-decoder-${SUFFIX}.onnx not found!"
319+
ls -lh packages/models/dist/ || echo "Directory does not exist"
307320
exit 1
308321
fi
309322
ls -lh packages/models/dist/

0 commit comments

Comments
 (0)