Skip to content

Commit 5bc1d4c

Browse files
maxdubrinskymax
authored andcommitted
ci(sdk-node): add drift check and smoke test to CI
Without this, edits to crates/openshell-sdk-node/src/lib.rs that change the napi surface would silently land with stale index.js / index.d.ts, shipping a TypeScript SDK whose types lie about the runtime. - New mise tasks: sdk-node:install, sdk-node:build, sdk-node:smoke, and sdk-node:check. The :check task rebuilds the binding, fails if the regenerated index.{js,d.ts} differ from HEAD, then runs the smoke suite. - Wire sdk-node:check into [ci] so `mise run pre-commit` covers it. - New "TypeScript SDK" job in branch-checks.yml runs sdk-node:check on linux-amd64 (the generated files are platform-agnostic; one arch is sufficient to catch drift). - Commit crates/openshell-sdk-node/package-lock.json so `npm ci` in the new task is deterministic.
1 parent c2935a2 commit 5bc1d4c

5 files changed

Lines changed: 1939 additions & 2 deletions

File tree

.github/workflows/branch-checks.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,34 @@ jobs:
190190

191191
- name: Lint
192192
run: mise run markdown:lint
193+
194+
sdk-node:
195+
name: TypeScript SDK (openshell-sdk-node)
196+
needs: pr_metadata
197+
if: needs.pr_metadata.outputs.should_run == 'true'
198+
runs-on: linux-amd64-cpu8
199+
env:
200+
SCCACHE_GHA_ENABLED: "true"
201+
SCCACHE_GHA_VERSION: branch-checks-sdk-node
202+
container:
203+
image: ghcr.io/nvidia/openshell/ci:latest
204+
credentials:
205+
username: ${{ github.actor }}
206+
password: ${{ secrets.GITHUB_TOKEN }}
207+
steps:
208+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
209+
210+
- name: Configure GHA sccache backend
211+
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
212+
213+
- name: Install tools
214+
run: mise install --locked
215+
216+
- name: Cache Rust target and registry
217+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
218+
with:
219+
shared-key: rust-sdk-node
220+
cache-on-failure: "true"
221+
222+
- name: Verify SDK binding is in sync and smoke tests pass
223+
run: mise run sdk-node:check
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules/
2-
package-lock.json
32
*.node

0 commit comments

Comments
 (0)