mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
249 lines
8.8 KiB
YAML
249 lines
8.8 KiB
YAML
name: test / e2e / dojo
|
||
|
||
on:
|
||
push:
|
||
branches: [main]
|
||
paths:
|
||
- "packages/v1/**"
|
||
- "packages/v2/**"
|
||
- ".github/workflows/e2e_dojo.yml"
|
||
pull_request:
|
||
branches: [main]
|
||
paths:
|
||
- "packages/v1/**"
|
||
- "packages/v2/**"
|
||
- ".github/workflows/e2e_dojo.yml"
|
||
workflow_dispatch:
|
||
inputs:
|
||
branch:
|
||
description: "Branch to run the workflow on"
|
||
required: true
|
||
default: "main"
|
||
type: string
|
||
|
||
jobs:
|
||
dojo:
|
||
name: ${{ matrix.suite }}
|
||
runs-on: depot-ubuntu-24.04
|
||
timeout-minutes: 30
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
include:
|
||
- suite: a2a-middleware
|
||
test_path: tests/a2aMiddlewareTests
|
||
services: ["dojo", "a2a-middleware"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8011,tcp:localhost:8012,tcp:localhost:8013,tcp:localhost:8014
|
||
needs_python: true
|
||
- suite: adk-middleware
|
||
test_path: tests/adkMiddlewareTests
|
||
services: ["dojo", "adk-middleware"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8010
|
||
needs_python: true
|
||
- suite: agno
|
||
test_path: tests/agnoTests
|
||
services: ["dojo", "agno"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8002
|
||
needs_python: true
|
||
- suite: crew-ai
|
||
test_path: tests/crewAITests
|
||
services: ["dojo", "crew-ai"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8003
|
||
needs_python: true
|
||
- suite: langgraph-python
|
||
test_path: tests/langgraphPythonTests
|
||
services: ["dojo", "langgraph-platform-python"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8005
|
||
needs_python: true
|
||
- suite: langgraph-typescript
|
||
test_path: tests/langgraphTypescriptTests
|
||
services: ["dojo", "langgraph-platform-typescript"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8006
|
||
needs_python: false
|
||
- suite: langgraph-fastapi
|
||
test_path: tests/langgraphFastAPITests
|
||
services: ["dojo", "langgraph-fastapi"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8004
|
||
needs_python: true
|
||
- suite: llama-index
|
||
test_path: tests/llamaIndexTests
|
||
services: ["dojo", "llama-index"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8007
|
||
needs_python: true
|
||
- suite: mastra
|
||
test_path: tests/mastraTests
|
||
services: ["dojo", "mastra"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8008
|
||
needs_python: false
|
||
- suite: mastra-agent-local
|
||
test_path: tests/mastraAgentLocalTests
|
||
services: ["dojo"]
|
||
wait_on: http://localhost:9999
|
||
needs_python: false
|
||
- suite: middleware-starter
|
||
test_path: tests/middlewareStarterTests
|
||
services: ["dojo"]
|
||
wait_on: http://localhost:9999
|
||
needs_python: false
|
||
- suite: pydantic-ai
|
||
test_path: tests/pydanticAITests
|
||
services: ["dojo", "pydantic-ai"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8009
|
||
needs_python: true
|
||
- suite: server-starter
|
||
test_path: tests/serverStarterTests
|
||
services: ["dojo", "server-starter"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8000
|
||
needs_python: true
|
||
- suite: server-starter-all
|
||
test_path: tests/serverStarterAllFeaturesTests
|
||
services: ["dojo", "server-starter-all"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8001
|
||
needs_python: true
|
||
- suite: aws-strands
|
||
test_path: tests/awsStrandsTests
|
||
services: ["dojo", "aws-strands"]
|
||
wait_on: http://localhost:9999,tcp:localhost:8017
|
||
needs_python: true
|
||
|
||
steps:
|
||
- name: Checkout CPK
|
||
uses: actions/checkout@v4
|
||
with:
|
||
path: CopilotKit
|
||
ref: ${{ github.event.inputs.branch || github.ref }}
|
||
|
||
- name: Checkout AGUI
|
||
uses: actions/checkout@v4
|
||
with:
|
||
repository: ag-ui-protocol/ag-ui
|
||
path: ag-ui
|
||
ref: main
|
||
|
||
- name: Set up Node.js
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: "22"
|
||
|
||
- name: Install pnpm
|
||
uses: pnpm/action-setup@v4
|
||
with:
|
||
version: 10.13.1
|
||
|
||
# Now that pnpm is available, cache its store to speed installs
|
||
- name: Resolve pnpm store path
|
||
id: pnpm-store
|
||
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
|
||
|
||
- name: Cache pnpm store
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
|
||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-pnpm-store-
|
||
|
||
# Cache Python tool caches and virtualenvs; restore only to avoid long saves
|
||
- name: Cache Python dependencies (restore-only)
|
||
if: ${{ matrix.needs_python }}
|
||
id: cache-python
|
||
uses: actions/cache/restore@v4
|
||
with:
|
||
path: |
|
||
~/.cache/pip
|
||
~/.cache/pypoetry
|
||
~/.cache/uv
|
||
**/.venv
|
||
key: ${{ runner.os }}-pydeps-${{ hashFiles('**/poetry.lock', '**/pyproject.toml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-pydeps-
|
||
|
||
- name: Install Poetry
|
||
if: ${{ matrix.needs_python }}
|
||
uses: snok/install-poetry@v1
|
||
with:
|
||
version: latest
|
||
virtualenvs-create: true
|
||
virtualenvs-in-project: true
|
||
|
||
- name: Install uv
|
||
if: ${{ matrix.needs_python }}
|
||
uses: astral-sh/setup-uv@v6
|
||
|
||
- name: Install cpk dependencies
|
||
working-directory: CopilotKit
|
||
run: pnpm install --frozen-lockfile
|
||
|
||
- name: Build cpk packages
|
||
working-directory: CopilotKit
|
||
env:
|
||
NODE_OPTIONS: --max-old-space-size=8192
|
||
NX_PARALLEL: 2
|
||
run: pnpm build
|
||
|
||
- name: Install ag-ui dependencies
|
||
working-directory: ag-ui
|
||
run: pnpm install --frozen-lockfile
|
||
|
||
- name: Link cpk into ag-ui
|
||
working-directory: CopilotKit
|
||
run: node ../ag-ui/apps/dojo/scripts/link-cpk.js ${{ github.workspace }}/CopilotKit/packages/v1
|
||
|
||
- name: Prepare dojo for e2e
|
||
working-directory: ag-ui/apps/dojo
|
||
env:
|
||
NODE_OPTIONS: --max-old-space-size=8192
|
||
if: ${{ join(matrix.services, ',') != '' }}
|
||
run: node ./scripts/prep-dojo-everything.js --only ${{ join(matrix.services, ',') }}
|
||
|
||
- name: Install e2e dependencies
|
||
working-directory: ag-ui/apps/dojo/e2e
|
||
run: |
|
||
pnpm install
|
||
|
||
- name: write langgraph env files
|
||
working-directory: ag-ui/integrations/langgraph
|
||
env:
|
||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}
|
||
if: ${{ contains(join(matrix.services, ','), 'langgraph-fastapi') || contains(join(matrix.services, ','), 'langgraph-platform-python') || contains(join(matrix.services, ','), 'langgraph-platform-typescript') }}
|
||
run: |
|
||
echo "OPENAI_API_KEY=${OPENAI_API_KEY}" > python/examples/.env
|
||
echo "LANGSMITH_API_KEY=${LANGSMITH_API_KEY}" >> python/examples/.env
|
||
echo "OPENAI_API_KEY=${OPENAI_API_KEY}" > typescript/examples/.env
|
||
echo "LANGSMITH_API_KEY=${LANGSMITH_API_KEY}" >> typescript/examples/.env
|
||
|
||
- name: Run dojo+agents
|
||
uses: JarvusInnovations/background-action@v1
|
||
env:
|
||
NODE_OPTIONS: --max-old-space-size=8192
|
||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}
|
||
GOOGLE_API_KEY: ${{ secrets.GOOGLE_GEMINI_API_KEY }}
|
||
if: ${{ join(matrix.services, ',') != '' && contains(join(matrix.services, ','), 'dojo') }}
|
||
with:
|
||
run: |
|
||
node ../scripts/run-dojo-everything.js --only ${{ join(matrix.services, ',') }}
|
||
working-directory: ag-ui/apps/dojo/e2e
|
||
wait-on: ${{ matrix.wait_on }}
|
||
wait-for: 300000
|
||
|
||
- name: Run tests – ${{ matrix.suite }}
|
||
working-directory: ag-ui/apps/dojo/e2e
|
||
env:
|
||
NODE_OPTIONS: --max-old-space-size=8192
|
||
BASE_URL: http://localhost:9999
|
||
PLAYWRIGHT_SUITE: ${{ matrix.suite }}
|
||
run: |
|
||
pnpm test -- ${{ matrix.test_path }}
|
||
|
||
- name: Upload traces – ${{ matrix.suite }}
|
||
if: always() # Uploads artifacts even if tests fail
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ matrix.suite }}-playwright-traces
|
||
path: |
|
||
ag-ui/apps/dojo/e2e/test-results/${{ matrix.suite }}/**/*
|
||
ag-ui/apps/dojo/e2e/playwright-report/**/*
|
||
retention-days: 7
|