Model Groups spawn router #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cross-platform CI for pi-agenticoding | |
| # | |
| # Runs the full unit suite on Linux, macOS, and Windows | |
| # on the minimum Node.js version required by pi coding agent. Snapshot | |
| # tests verify TUI render output against golden files. | |
| name: test | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: ['*.md', '**/docs/**'] | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: ['*.md', '**/docs/**'] | |
| jobs: | |
| # ── Cross-platform test matrix ────────────────────────────────────── | |
| # Node 22 (minimum) is tested only on Linux — the primary platform and the only one | |
| # guaranteed to have the oldest toolchain. macOS and Windows test Node 24 (latest) | |
| # to catch regressions in the newest runtime. This asymmetry is intentional: it | |
| # balances CI cost with meaningful coverage while ensuring the minimum version works | |
| # correctly on the platform most likely to encounter toolchain edge cases. | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false # report every combination, don't cancel | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| node-version: "22" # minimum version on primary platform | |
| - os: ubuntu-latest | |
| node-version: "24" # latest on primary platform | |
| - os: macos-latest | |
| node-version: "24" # latest on macOS | |
| - os: windows-latest | |
| node-version: "24" # latest on Windows | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "npm" | |
| - run: npm ci | |
| # Uniform pre-flight checks — type errors and runtime dependency security issues on every platform. | |
| # npm audit includes devDependencies by default. Here the pi packages are peerDependencies for | |
| # runtime/library use and devDependencies only so CI can typecheck and test against the Pi SDK. | |
| # The current full dev audit is blocked by @earendil-works/pi-coding-agent's published | |
| # npm-shrinkwrap.json pinning nested protobufjs/ws versions. Root npm overrides do not override | |
| # those shrinkwrapped nested packages, and the broader upstream packaging discussion is tracked | |
| # in earendil-works/pi#5653 ("Move off Shrinkwrap"). The relevant GitHub advisories were | |
| # published to the audit DB on 2026-06-15, after PR #13 introduced this workflow, so enforcing | |
| # full dev audit now would fail unrelated PRs until upstream publishes a fixed shrinkwrap. | |
| # Keep the runtime dependency audit strict here; restore full dev audit after the upstream fix | |
| # is released and consumed by package.json/package-lock.json. | |
| - name: Type check | |
| run: npx tsc --noEmit | |
| - name: Security audit | |
| run: npm audit --omit=dev --audit-level=moderate | |
| # Unit suite (unit tests + snapshot tests + property-based tests) | |
| - name: Unit tests | |
| run: npm test | |
| # E2E tests — process-isolated child-process harness (stdin/stdout, no PTY). | |
| # Verified cross-platform: runs on Linux, macOS, and Windows. | |
| # See https://github.com/agenticoding/pi-agenticoding/issues/12 | |
| - name: E2E tests | |
| run: npm run test:e2e | |
| # Upload test results for debugging — artifacts available for 30 days. | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.os }}-node-${{ matrix.node-version }} | |
| path: | | |
| tests/snapshots/ | |
| retention-days: 30 |