119 lines
3.9 KiB
YAML
119 lines
3.9 KiB
YAML
name: test / integration / runtime
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "packages/runtime/**"
|
|
- ".github/workflows/test_integration-runtime.yml"
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "packages/runtime/**"
|
|
- ".github/workflows/test_integration-runtime.yml"
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch:
|
|
description: "Branch to run the workflow on"
|
|
required: true
|
|
default: "main"
|
|
type: string
|
|
|
|
# Least-privilege by default. Individual jobs/steps can widen when needed.
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
node:
|
|
name: "runtime / node"
|
|
runs-on: depot-ubuntu-24.04-4
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
# id-token: write is required for Depot OIDC auth (runs-on: depot-ubuntu-*).
|
|
id-token: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
|
with:
|
|
ref: ${{ github.event.inputs.branch || github.ref }}
|
|
persist-credentials: false
|
|
|
|
- name: Setup pnpm
|
|
# Omit `version:` so pnpm/action-setup inherits from the repo's
|
|
# `packageManager` field in package.json (via corepack).
|
|
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
|
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: "22.x"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Configure Nx Cloud environment
|
|
run: |
|
|
echo "NX_CI_EXECUTION_ID=${{ github.run_id }}-${{ github.run_attempt }}-integration-node" >> $GITHUB_ENV
|
|
echo "NX_CLOUD_NO_TIMEOUTS=true" >> $GITHUB_ENV
|
|
echo "NX_CLOUD_DISTRIBUTED_EXECUTION=false" >> $GITHUB_ENV
|
|
echo "NX_NO_CLOUD=true" >> $GITHUB_ENV
|
|
|
|
- name: Build runtime
|
|
run: pnpm nx run @copilotkit/runtime:build
|
|
|
|
- name: Run Node.js server integration tests
|
|
working-directory: packages/runtime
|
|
run: pnpm exec vitest run src/v2/runtime/__tests__/integration/node-servers.integration.test.ts
|
|
|
|
bun:
|
|
name: "runtime / bun"
|
|
runs-on: depot-ubuntu-24.04-4
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
# id-token: write is required for Depot OIDC auth (runs-on: depot-ubuntu-*).
|
|
id-token: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
|
with:
|
|
ref: ${{ github.event.inputs.branch || github.ref }}
|
|
persist-credentials: false
|
|
|
|
- name: Setup pnpm
|
|
# Omit `version:` so pnpm/action-setup inherits from the repo's
|
|
# `packageManager` field in package.json (via corepack).
|
|
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
|
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: "22.x"
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Configure Nx Cloud environment
|
|
run: |
|
|
echo "NX_CI_EXECUTION_ID=${{ github.run_id }}-${{ github.run_attempt }}-integration-bun" >> $GITHUB_ENV
|
|
echo "NX_CLOUD_NO_TIMEOUTS=true" >> $GITHUB_ENV
|
|
echo "NX_CLOUD_DISTRIBUTED_EXECUTION=false" >> $GITHUB_ENV
|
|
echo "NX_NO_CLOUD=true" >> $GITHUB_ENV
|
|
|
|
- name: Build runtime
|
|
run: pnpm nx run @copilotkit/runtime:build
|
|
|
|
- name: Run Bun server integration tests
|
|
working-directory: packages/runtime
|
|
run: bun test src/v2/runtime/__tests__/integration/bun/bun-servers.integration.test.ts
|