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