-
Notifications
You must be signed in to change notification settings - Fork 92
70 lines (60 loc) · 2.81 KB
/
Copy pathembedding-backend.yml
File metadata and controls
70 lines (60 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Embedding Backend Verification
# Verifies the local @huggingface/transformers embedding backend installs and
# runs across platforms — specifically that the native ONNX runtime + prebuilt
# sharp (@img/*) load under a script-skipping install on macOS, Linux and
# Windows. The migration off @xenova/transformers was previously reverted
# (8fb0836) due to native ONNX crashes under Windows + Bun, so Windows is a
# first-class target here, not an afterthought.
on:
pull_request:
paths:
- "package.json"
- "bun.lock"
- "src/services/embedding.ts"
- "scripts/verify-embedding-backend.mjs"
- ".github/workflows/embedding-backend.yml"
workflow_dispatch:
jobs:
verify:
name: ${{ matrix.os }} / bun
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
# Mimic OpenCode's plugin install, which does not run lifecycle scripts.
# The whole point is that prebuilt @img/sharp-* and onnxruntime-node
# binaries must arrive without a postinstall build step.
- name: Install (no scripts — mimics OpenCode plugin install)
run: bun install --ignore-scripts
- name: Assert native binaries present without postinstall
shell: bash
run: |
set -e
echo "Checking prebuilt sharp (@img) ..."
ls node_modules/@img/sharp-*/lib/*.node
echo "Checking onnxruntime-node native binding ..."
# path varies by platform/napi version — just require at least one .node
found=$(find node_modules/onnxruntime-node/bin -name '*.node' | head -1)
test -n "$found" && echo "onnxruntime binding: $found"
# This workflow deliberately does NOT run `bun run build` or the full
# `bun test` suite. Those have pre-existing cross-platform issues unrelated
# to the embedding backend (the build script uses `cp -r`, which fails on
# Windows; one config test asserts a macOS-shaped storagePath). They belong
# in a general CI workflow, not here. This job's single purpose is to prove
# the @huggingface/transformers embedding backend installs and runs across
# platforms, which needs neither the built plugin nor the unit tests.
# The revert-critical check: load the ONNX runtime and run a real
# feature-extraction embedding under Bun on this platform.
- name: Embedding smoke (Bun)
run: bun scripts/verify-embedding-backend.mjs
# Node path too — OpenCode's plugin sidecar is Node-based in 1.15.x.
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Embedding smoke (Node)
run: node scripts/verify-embedding-backend.mjs