scripts/check-licenses.mjs (npm run check:licenses) reads the production dependency closures of the sidecar (@waggle/server minus the packages stage-sidecar-deps.mjs never ships) and the web UI (apps/web) from package-lock.json and fails on GPL, AGPL, SSPL, missing and unknown licenses. It allows permissive licenses plus MPL-2.0 and lists named exceptions with reasons; LGPL libvips and node-webpmux, the OFL fonts and the unlicensed buffers package are marked as pending the licensing review. app/src-tauri/deny.toml applies the same allowlist to the Tauri crates with cargo-deny; the npm check fails when the two lists drift apart. A new CI job runs both, with cargo-deny 0.18.3 installed and cached in CI. scripts/license-inventory.mjs holds the shared closure logic.
215 lines
6.9 KiB
YAML
215 lines
6.9 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
|
|
|
|
# License gate (P2.3). The npm check reads the shipped closures from
|
|
# package-lock.json, so it needs no install. cargo-deny checks the crates of
|
|
# the desktop shell against app/src-tauri/deny.toml; it is pinned, cached,
|
|
# and fetches the crates itself.
|
|
licenses:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CARGO_DENY_VERSION: 0.18.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.23.2
|
|
|
|
- name: Licenses — shipped npm packages
|
|
run: npm run check:licenses
|
|
|
|
- name: Cache cargo-deny
|
|
id: cargo-deny-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cargo/bin/cargo-deny
|
|
key: ${{ runner.os }}-cargo-deny-${{ env.CARGO_DENY_VERSION }}
|
|
|
|
- name: Install cargo-deny
|
|
if: steps.cargo-deny-cache.outputs.cache-hit != 'true'
|
|
run: cargo install cargo-deny --locked --version "$CARGO_DENY_VERSION"
|
|
|
|
- name: Licenses — Rust crates (cargo-deny)
|
|
run: cargo deny --manifest-path app/src-tauri/Cargo.toml check licenses
|
|
|
|
# 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
|