The committed MCP bundle is the only thing that ships, but nothing checked that it matched src/. The gate could not be added while CI ran 'bun-version: latest': that resolved to 1.4.2, and the minifier allocates identifiers differently across Bun releases, so the runner rebuilt the macOS/1.3.14-built bundle into different bytes — identical code, renamed variables (N/S, A/I, q/p). Measured on #116. Pin bun-version to 1.3.14 in both workflows, matching the local toolchain and the @types/bun/bun-types already declared in package.json, then add the diff gate alongside the existing boot check. The boot check stays: a bundle that cannot start is invisible to a byte diff when it is in sync with its broken source, which is exactly how #114 shipped.
68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
name: 🧪 CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-and-check:
|
|
name: 🧪 Test, Type-Check & Build Validation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.14
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Type-check
|
|
run: bun run check
|
|
|
|
- name: Colocated Unit Tests
|
|
run: bun test
|
|
|
|
- name: Build OpenAPI & Validate Sync
|
|
run: |
|
|
bun run openapi:bundle
|
|
git diff --exit-code dist/openapi.json || (echo "::error::dist/openapi.json is out of sync with openapi/openapi.yaml. Run 'bun run openapi:bundle' and commit changes." && exit 1)
|
|
|
|
- name: Build MCP Plugin & Verify
|
|
run: |
|
|
bun run build:plugin
|
|
git diff --exit-code dist/mcp/server.js || (echo "::error::dist/mcp/server.js is out of sync with src/. Run 'bun run build:plugin' and commit changes." && exit 1)
|
|
# Boot the freshly built bundle and complete an MCP handshake. A bundle that cannot start
|
|
# is invisible to source-level tests — this has regressed before, when circular imports
|
|
# scrambled zod's initialisation order and shipped an entry point that never answered.
|
|
# Re-running the server tests here points them at the artifact just built, not the
|
|
# committed one.
|
|
#
|
|
# The diff gate above depends on bun-version being pinned: the minifier allocates
|
|
# identifiers differently across Bun releases, so an unpinned runner rebuilds to
|
|
# different bytes (measured: a bun 1.4.2 rebuild of a 1.3.14-built bundle differed only
|
|
# by renamed minified variables). Keep the pin in step with the committed bundle.
|
|
bun test src/server.test.ts
|
|
|
|
- name: Verify Binary Compilation
|
|
run: |
|
|
mkdir -p dist/bin
|
|
bun run build:binary
|