agent-orchestrator/.github/workflows/ci.yml

104 lines
3.8 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Minimal token scope — all jobs only checkout, install, build, and test.
# None of them push code, comment on PRs, or call mutating GitHub APIs.
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
# Build all non-web packages
- run: pnpm -r --filter "!@aoagents/ao-web" build
# Typecheck all non-web packages
- run: pnpm -r --filter "!@aoagents/ao-web" typecheck
# Build web (Next.js build includes its own typecheck)
- run: pnpm --filter @aoagents/ao-web build
test:
name: Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm -r --filter "!@aoagents/ao-web" build
# Verify node-pty's Windows prebuild loads cleanly before any test that
# depends on it. A broken prebuild fails this step in seconds with a
# clear "node-pty" stack rather than a buried integration-test failure.
- name: Verify node-pty prebuild (Windows)
if: runner.os == 'Windows'
working-directory: packages/plugins/runtime-process
run: node -e "const p=require('node-pty');const t=p.spawn('cmd.exe',['/c','exit'],{cols:80,rows:24});t.onExit(({exitCode})=>process.exit(exitCode));setTimeout(()=>process.exit(2),5000)"
- run: pnpm test
test-web:
name: Test Web (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: 20
cache: pnpm
# tmux is the Linux/macOS terminal runtime backing direct-terminal-ws
# integration tests. Windows uses runtime-process + named pipes (covered
# by mux-websocket-windows.test.ts) — those tmux tests self-skip.
- name: Install tmux
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y tmux
- name: Start tmux server
if: runner.os == 'Linux'
run: tmux start-server
- run: pnpm install --frozen-lockfile
- run: pnpm -r --filter "!@aoagents/ao-web" build
# Full web suite — components, hooks, libs, app routes, and server tests.
# Previously this job was scoped to server/__tests__/ only; broadening it
# closes a long-standing coverage gap on both Linux and Windows.
- run: pnpm --filter @aoagents/ao-web test