Open History to see the last commit
1name: Bun Tests
2
3# The `@tanstack/ai-isolate-quickjs-bun` driver runs QuickJS natively through
4# `bun:ffi`, so its substantive test suite (escape attempts, timeouts, memory
5# limits, maxToolCalls, concurrency) is gated with
6# `describe.skipIf(typeof Bun === 'undefined')` and only runs under Bun. The
7# standard PR job (`pr.yml`) runs Vitest on Node and therefore only exercises
8# the "rejects createContext on Node.js" case. This workflow runs the Bun-gated
9# suite so that behavior is actually covered in CI.
10#
11# It is path-filtered to the package (and this file) to keep it off unrelated
12# PRs.
13
14on:
15 pull_request:
16 paths:
17 - 'packages/ai-isolate-quickjs-bun/**'
18 - 'packages/ai-code-mode/**'
19 - '.github/workflows/bun-test.yml'
20
21concurrency:
22 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
23 cancel-in-progress: true
24
25env:
26 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
27
28permissions:
29 contents: read
30
31jobs:
32 test:
33 name: Test (Bun)
34 runs-on: ubuntu-latest
35 steps:
36 - name: Checkout
37 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38 with:
39 persist-credentials: false
40 - name: Setup Tools
41 uses: TanStack/config/.github/setup@190f659075ff0845850e330883eb26d7ffd0671f # main
42 - name: Setup Bun
43 uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
44 with:
45 # The driver requires Bun >= 1.3.14 (see the package `engines` field).
46 bun-version: latest
47 - name: Build package and its workspace dependencies
48 # `@tanstack/ai-code-mode` is a `workspace:*` peer dependency and is
49 # imported at runtime (`wrapCode`) by the driver, so it must be built to
50 # `dist/` before the Bun tests can import it. nx builds the dependency
51 # graph first via `^build`.
52 run: pnpm exec nx build @tanstack/ai-isolate-quickjs-bun
53 - name: Run Bun test suite
54 run: pnpm --filter @tanstack/ai-isolate-quickjs-bun run test:bun