Add OpenRouter GLM-V CUA support #179
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build --workspace @onkernel/cua-ai | |
| - name: Unit tests | |
| run: npm test --workspace @onkernel/cua-ai | |
| - name: Pack tarball | |
| run: npm pack --workspace @onkernel/cua-ai --pack-destination "$RUNNER_TEMP" | |
| - name: ESM import smoke test | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/esm-smoke" | |
| cd "$RUNNER_TEMP/esm-smoke" | |
| npm init -y | |
| npm install "$RUNNER_TEMP"/onkernel-cua-ai-*.tgz | |
| node --input-type=module -e "import('@onkernel/cua-ai').then((m) => { if (typeof m.getCuaModel !== 'function') process.exit(1); })" | |
| agent-unit: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build --workspace @onkernel/cua-ai | |
| - name: Agent unit tests | |
| run: npm test --workspace @onkernel/cua-agent -- --exclude "**/*.live.test.ts" | |
| cli-unit: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| PTYWRIGHT_ZIG_VERSION: "0.15.2" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: Cache Zig toolchain | |
| uses: actions/cache@v4 | |
| with: | |
| path: .dev/tools/zig-x86_64-linux-${{ env.PTYWRIGHT_ZIG_VERSION }} | |
| key: zig-${{ runner.os }}-${{ env.PTYWRIGHT_ZIG_VERSION }} | |
| - name: Install Zig ${{ env.PTYWRIGHT_ZIG_VERSION }} | |
| run: | | |
| set -euo pipefail | |
| ZIG_DIR=".dev/tools/zig-x86_64-linux-${PTYWRIGHT_ZIG_VERSION}" | |
| if [ ! -x "${ZIG_DIR}/zig" ]; then | |
| mkdir -p .dev/tools | |
| curl -fsSL "https://ziglang.org/download/${PTYWRIGHT_ZIG_VERSION}/zig-x86_64-linux-${PTYWRIGHT_ZIG_VERSION}.tar.xz" \ | |
| | tar -xJ -C .dev/tools | |
| fi | |
| "${ZIG_DIR}/zig" version | |
| echo "${GITHUB_WORKSPACE}/${ZIG_DIR}" >> "${GITHUB_PATH}" | |
| - name: Cache ptywright native artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/ptywright/.cache | |
| packages/ptywright/native/build | |
| key: ptywright-${{ runner.os }}-${{ hashFiles('packages/ptywright/GHOSTTY_UPSTREAM', 'packages/ptywright/native/**', 'packages/ptywright/scripts/**') }} | |
| - run: npm run build --workspace @onkernel/cua-ai | |
| - run: npm run build --workspace @onkernel/cua-agent | |
| - name: Typecheck workspace | |
| run: npx tsc -b | |
| - name: Build ptywright (native binding) | |
| run: npm run build --workspace @onkernel/ptywright | |
| - name: CLI unit tests | |
| env: | |
| PTYWRIGHT_REQUIRED: "1" | |
| run: npm test --workspace @onkernel/cua-cli | |
| - name: Build cua-cli | |
| run: npm run build --workspace @onkernel/cua-cli | |
| - name: Pack tarball | |
| run: npm pack --workspace @onkernel/cua-cli --pack-destination "$RUNNER_TEMP" | |
| - name: CLI bin smoke test | |
| run: | | |
| SMOKE_DIR=$(mktemp -d) | |
| cd "$SMOKE_DIR" | |
| npm init -y > /dev/null | |
| npm install "$RUNNER_TEMP"/onkernel-cua-cli-*.tgz | |
| OUTPUT=$(./node_modules/.bin/cua --help) | |
| echo "$OUTPUT" | |
| echo "$OUTPUT" | grep -q "Usage:" | |
| echo "$OUTPUT" | grep -q "cua \[options\] \[prompt\.\.\.\]" | |
| integration: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| # Only run on the main repo (not forks) so secrets are available. | |
| # Skip draft PRs; still run on every commit to non-draft PRs and on main pushes. | |
| if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft) | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build --workspace @onkernel/cua-ai | |
| - name: Integration tests | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| TZAFON_API_KEY: ${{ secrets.TZAFON_API_KEY }} | |
| YUTORI_API_KEY: ${{ secrets.YUTORI_API_KEY }} | |
| run: npm run test:integration --workspace @onkernel/cua-ai | |
| agent-e2e: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| # Only run on the main repo (not forks) so secrets are available. | |
| # Skip draft PRs; still run on every commit to non-draft PRs and on main pushes. | |
| if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft) | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build --workspace @onkernel/cua-ai | |
| - run: npm run build --workspace @onkernel/cua-agent | |
| - name: Agent live smoke tests (all providers) | |
| env: | |
| CUA_E2E_LIVE: "1" | |
| KERNEL_API_KEY: ${{ secrets.KERNEL_API_KEY }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| TZAFON_API_KEY: ${{ secrets.TZAFON_API_KEY }} | |
| YUTORI_API_KEY: ${{ secrets.YUTORI_API_KEY }} | |
| run: npm test --workspace @onkernel/cua-agent -- test/e2e.live.test.ts |