Files
waggle-os/.github/workflows/ci.yml
shumeiko.it 23431550ae build: one tsc -b build and a source export condition (P2.1)
- tsconfig.build.json references the nine in-scope packages; each package
  is composite and references the workspace packages it depends on.
  build:packages is now `tsc -b tsconfig.build.json` instead of a chain
  of cd commands.
- Every in-scope package exports its TypeScript entry under a `source`
  condition next to the dist/ entries. Vitest, tsx (dev:server, the
  Tauri dev launch, the e2e server), the sidecar and launcher bundles and
  the web app resolve it, so none of them needs build:packages first or
  can pick up a stale dist/. The vitest src aliases remain only for the
  excluded packages that have no source export.
- Published packages with a files list (agent, cli, marketplace) pack
  src/ too, so the source condition never points at a missing file.
- tsconfig.tests.json and `npm run typecheck:tests` type-check the test
  suites of the in-scope packages. They report 426 existing errors, so
  the CI step is advisory for now.
- The root test run leaves out the excluded and postponed packages
  (hive-mind-*, memory-mcp, wiki-compiler, team-server, waggle-dance,
  worker, weaver); they are not built either.
- CI runs the test job on Ubuntu, macOS and Windows with Node 22.23.2
  (ADR-0008), and no longer builds the hook runtime and the memory MCP
  server.
2026-10-24 17:14:29 +02:00

183 lines
5.8 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# Runs on the three desktop platforms of the community edition (P1.3b, P2.1).
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# The Node version the installer and the desktop app ship (ADR-0008).
- uses: actions/setup-node@v4
with:
node-version: 22.23.2
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- run: npm install
env:
ONNXRUNTIME_NODE_INSTALL_CUDA: skip
# One `tsc -b` over the project references in tsconfig.build.json: every
# in-scope @waggle/* package, in dependency order.
- name: Type check — workspace packages (tsc -b)
run: npm run build:packages
- name: Type check — web (apps/web, tsc -p tsconfig.app.json)
run: npm run typecheck:web
# Advisory until the existing test type errors are fixed.
- name: Type check — tests (tsconfig.tests.json)
run: npm run typecheck:tests
continue-on-error: true
- name: Lint (root flat config)
run: npm run lint
- name: Workspace dependency declarations
run: npm run check:deps
- name: Tauri TS typecheck (app/scripts)
run: npx tsc -p app/tsconfig.json
# Runtime tests pack and install workspace packages. Build every ignored
# dist/ payload explicitly so CI proves a fresh checkout.
- name: Build package-install test runtimes
run: |
npm run build --workspace @waggle/cli
npm run build --workspace @waggle-ai/waggle
- name: Unit tests — packages + cross-cutting (root vitest)
run: >-
npm test --
--exclude=packages/cli/tests/cli-runtime.test.ts
--exclude=packages/marketplace/tests/cli-runtime.test.ts
--exclude=packages/launcher/tests/cli.test.ts
--maxWorkers=2
# These tests each create a temporary project and run npm install. Running
# several cold installs in parallel makes individual test timeouts measure
# runner contention rather than package correctness.
- name: Package-install runtime tests (serial)
run: >-
npx vitest run
packages/cli/tests/cli-runtime.test.ts
packages/marketplace/tests/cli-runtime.test.ts
packages/launcher/tests/cli.test.ts
--maxWorkers=1
--no-file-parallelism
# The root vitest.config.ts excludes `apps/**`; apps/web runs its own
# suite (jsdom).
- name: Unit tests — apps/web
run: npm run test -w apps/web
- name: Security audit (informational)
run: npm audit --audit-level=high
continue-on-error: true
# ADVISORY / NON-BLOCKING. `continue-on-error: true` means a red e2e run does
# NOT block merges — by design. These specs are broad product/audit journeys
# (full-product-audit, power-user-stress, competitive-benchmarks, …) that are
# historically flake-prone, so gating merges on them would produce false reds.
# The blocking `e2e-smoke` job above covers the stable launch, settings,
# memory, workspace, and mobile regression slice. This broad job stays
# advisory so exploratory audit coverage can report flakes without blocking
# merges.
e2e-smoke:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.23.2
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- run: npm install
- name: Build packages
run: npm run build:packages
- name: Build frontend
run: npm run build
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run blocking Playwright smoke journeys
run: npm run test:e2e:smoke
env:
WAGGLE_ECHO_MODE: "1"
NODE_ENV: test
WAGGLE_TRUST_LOCALHOST: "1"
e2e:
runs-on: ubuntu-latest
needs: test
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.23.2
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- run: npm install
# apps/web's tsc build imports @waggle/shared etc. which export dist/;
# build the workspace packages first (the deploy does this via build:all).
- name: Build packages
run: npm run build:packages
- name: Build frontend
run: npm run build
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright E2E tests
run: npx playwright test tests/e2e/
env:
WAGGLE_ECHO_MODE: "1"
NODE_ENV: test
# D1: the e2e suite hits /api/* directly without a bearer token; trust
# loopback in CI's test server (prod default stays secure). Mirrors
# vitest.setup.ts and playwright.config.ts webServer.env.
WAGGLE_TRUST_LOCALHOST: "1"
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 14