-
Notifications
You must be signed in to change notification settings - Fork 149
93 lines (79 loc) · 2.89 KB
/
Copy pathplatform-smoke.yml
File metadata and controls
93 lines (79 loc) · 2.89 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Platform Package Smoke
on:
pull_request:
paths:
- "package.json"
- "bun.lock"
- "tsconfig.json"
- "src/**"
- "scripts/native-deps-smoke.mjs"
- "scripts/verify-libsql-vector.mjs"
- "scripts/verify-nested-onnxruntime-fixture.mjs"
- "scripts/smoke-test.mjs"
- "web/**"
- ".github/workflows/platform-smoke.yml"
workflow_dispatch:
jobs:
package-smoke:
name: ${{ matrix.os }} / package smoke
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Intel: macos-15-intel / macos-26-intel (darwin/x64).
# Apple Silicon: macos-15 / macos-26 (darwin/arm64).
os:
- ubuntu-latest
- windows-latest
- macos-15-intel
- macos-26-intel
- macos-15
- macos-26
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: "24"
package-manager-cache: false
- name: Install source dependencies
run: bun install
- name: Install web dependencies
working-directory: web
run: bun install
- name: Typecheck source
run: bun run typecheck
- name: Build package artifacts
run: bun run build
- name: Run test suite
run: bun test
- name: Pack and install published package shape
shell: bash
run: |
set -euo pipefail
pack_dir="$RUNNER_TEMP/opencode-mem-pack"
smoke_dir="$RUNNER_TEMP/opencode-mem-smoke"
mkdir -p "$pack_dir" "$smoke_dir"
npm pack --pack-destination "$pack_dir"
tarball_path=$(find "$pack_dir" -name "opencode-mem-*.tgz" -print -quit)
test -n "$tarball_path"
cd "$smoke_dir"
npm init -y
# npm ignores overrides declared by installed dependencies, so mirror the plugin's
# native-runtime pin at the temporary root used by this package smoke test.
override_version=$(node --input-type=module -e '
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
const pkg = JSON.parse(readFileSync(resolve(process.env.GITHUB_WORKSPACE, "package.json"), "utf8"));
process.stdout.write(pkg.overrides?.["onnxruntime-node"] ?? "");
')
if [ -n "$override_version" ]; then
npm pkg set "overrides.onnxruntime-node=$override_version"
fi
npm install --ignore-scripts "$tarball_path"
cp "$GITHUB_WORKSPACE/scripts/native-deps-smoke.mjs" ./native-deps-smoke.mjs
cp "$GITHUB_WORKSPACE/scripts/verify-libsql-vector.mjs" ./verify-libsql-vector.mjs
cp "$GITHUB_WORKSPACE/scripts/smoke-test.mjs" ./smoke-test.mjs
node ./native-deps-smoke.mjs
node ./verify-libsql-vector.mjs
node ./smoke-test.mjs