Skip to content

Exactly-once for external tool effects, and the Bun CI job green again #41

Exactly-once for external tool effects, and the Bun CI job green again

Exactly-once for external tool effects, and the Bun CI job green again #41

Workflow file for this run

name: TypeScript SDK CI
on:
push:
branches: [main]
paths: ['sdk/typescript/**', '.github/workflows/ts-sdk.yml']
pull_request:
paths: ['sdk/typescript/**', '.github/workflows/ts-sdk.yml']
jobs:
test-node:
name: Test (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
matrix:
node: ['20', '22']
defaults:
run:
working-directory: sdk/typescript
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
with:
version: 9
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: pnpm
cache-dependency-path: sdk/typescript/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
# Build before typecheck so @jamjet/cloud-vercel can resolve
# @jamjet/cloud's emitted .d.ts (workspace dep typecheck order).
- run: pnpm build
- run: pnpm typecheck
- run: pnpm test
- run: pnpm size
test-bun:
name: Test (Bun)
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk/typescript
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
with:
version: 9
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: pnpm
cache-dependency-path: sdk/typescript/pnpm-lock.yaml
- uses: oven-sh/setup-bun@v2
- run: pnpm install --frozen-lockfile
# Build first: the smoke check imports the emitted bundle, which is what a
# Bun user actually installs.
- run: pnpm build
# A plain Bun script, not `vitest` under `--bun`.
#
# This step used to be `bun --bun pnpm test`. Bun resolves the first
# argument as a package.json script or a node_modules/.bin entry, and
# pnpm/action-setup v6 installs pnpm globally instead, so it died with
# `Script not found "pnpm"` on every commit from 2026-05-13 onward.
#
# Fixing the invocation revealed why it was worth fixing: vitest under the
# Bun runtime cannot resolve zod's named export, so every suite failed on
# `z.object`. That is a property of vitest's module runner, not of this
# SDK — it says nothing about whether the package works for a Bun user,
# which is the only question this job exists to answer. So ask that
# question directly.
- run: bun run scripts/bun-smoke.ts
working-directory: sdk/typescript/packages/cloud