mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
190 lines
8.5 KiB
YAML
190 lines
8.5 KiB
YAML
name: test / integration / docs
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "showcase/shell-docs/src/content/**"
|
|
- "showcase/shell-docs/model-allowlist.json"
|
|
- "showcase/shell-docs/src/lib/__tests__/ms-agent-dotnet-provider.test.ts"
|
|
# The setup-concept gate below reads snippets owned by the integration
|
|
# packages and by the docs-only snippet tree, so a new or edited snippet
|
|
# has to trigger this workflow. Before OSS-1036 neither path was listed,
|
|
# and the coverage ratchet never ran in CI at all.
|
|
- "showcase/integrations/*/docs/setup/**"
|
|
- "showcase/integrations/*/manifest.yaml"
|
|
- "showcase/shell-docs/src/lib/setup-content.ts"
|
|
- "showcase/shell-docs/src/lib/setup-concept.tsx"
|
|
- "showcase/shell-docs/src/components/mdx-code-block.tsx"
|
|
- "showcase/shell-docs/src/lib/mdx-registry-loader.tsx"
|
|
- "showcase/shell-docs/src/lib/rehype-code-meta.ts"
|
|
- "showcase/shell-docs/src/lib/__tests__/frontend-tools-setup-coverage.test.ts"
|
|
- "showcase/shell-docs/src/lib/__tests__/setup-concept-rendering.test.tsx"
|
|
- "showcase/shell-docs/src/lib/__tests__/setup-concept.test.ts"
|
|
- "showcase/scripts/bundle-setup-content.ts"
|
|
- "showcase/shell-docs/package.json"
|
|
- "showcase/shell-docs/package-lock.json"
|
|
- "examples/integrations/ms-agent-framework-dotnet/**"
|
|
- "scripts/validate-doc-model-names.ts"
|
|
- "scripts/doc-tests/**"
|
|
- ".github/workflows/test_integration-docs.yml"
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "showcase/shell-docs/src/content/**"
|
|
- "showcase/shell-docs/model-allowlist.json"
|
|
- "showcase/shell-docs/src/lib/__tests__/ms-agent-dotnet-provider.test.ts"
|
|
# The setup-concept gate below reads snippets owned by the integration
|
|
# packages and by the docs-only snippet tree, so a new or edited snippet
|
|
# has to trigger this workflow. Before OSS-1036 neither path was listed,
|
|
# and the coverage ratchet never ran in CI at all.
|
|
- "showcase/integrations/*/docs/setup/**"
|
|
- "showcase/integrations/*/manifest.yaml"
|
|
- "showcase/shell-docs/src/lib/setup-content.ts"
|
|
- "showcase/shell-docs/src/lib/setup-concept.tsx"
|
|
- "showcase/shell-docs/src/components/mdx-code-block.tsx"
|
|
- "showcase/shell-docs/src/lib/mdx-registry-loader.tsx"
|
|
- "showcase/shell-docs/src/lib/rehype-code-meta.ts"
|
|
- "showcase/shell-docs/src/lib/__tests__/frontend-tools-setup-coverage.test.ts"
|
|
- "showcase/shell-docs/src/lib/__tests__/setup-concept-rendering.test.tsx"
|
|
- "showcase/shell-docs/src/lib/__tests__/setup-concept.test.ts"
|
|
- "showcase/scripts/bundle-setup-content.ts"
|
|
- "showcase/shell-docs/package.json"
|
|
- "showcase/shell-docs/package-lock.json"
|
|
- "examples/integrations/ms-agent-framework-dotnet/**"
|
|
- "scripts/validate-doc-model-names.ts"
|
|
- "scripts/doc-tests/**"
|
|
- ".github/workflows/test_integration-docs.yml"
|
|
|
|
# Least-privilege by default. Individual jobs/steps can widen when needed.
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate-model-names:
|
|
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:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
persist-credentials: false
|
|
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm tsx scripts/validate-doc-model-names.ts
|
|
|
|
ms-agent-dotnet-guidance:
|
|
name: Microsoft Agent Framework .NET guidance
|
|
runs-on: depot-ubuntu-24.04-4
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
id-token: write # zizmor: ignore[undocumented-permissions] Depot runner OIDC.
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
cache-dependency-path: showcase/shell-docs/package-lock.json
|
|
- name: Install shell-docs dependencies
|
|
working-directory: showcase/shell-docs
|
|
run: npm ci --ignore-scripts
|
|
- name: Check Microsoft Agent Framework .NET guidance
|
|
working-directory: showcase/shell-docs
|
|
run: npm exec -- vitest run src/lib/__tests__/ms-agent-dotnet-provider.test.ts
|
|
|
|
setup-concept-coverage:
|
|
name: Framework setup-concept coverage
|
|
runs-on: depot-ubuntu-24.04-4
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
id-token: write # zizmor: ignore[undocumented-permissions] Depot runner OIDC.
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
cache-dependency-path: showcase/shell-docs/package-lock.json
|
|
- name: Install dependencies
|
|
run: |
|
|
cd showcase/scripts && npm ci --ignore-scripts
|
|
cd ../shell-docs && npm ci --ignore-scripts
|
|
# `generate-registry.ts` imports the catalog fold out of the harness tree,
|
|
# which resolves `js-yaml` by walking up from `showcase/harness/`. Point
|
|
# that at the already-installed scripts tree instead of installing the
|
|
# harness package a second time. Same step as showcase/shell-docs/Dockerfile.
|
|
- name: Link harness module scope
|
|
run: ln -s ../scripts/node_modules showcase/harness/node_modules
|
|
# The bundled snippets live in `src/data/setup-content.json`, which is
|
|
# gitignored, so the tests cannot run until it is generated.
|
|
- name: Generate registry and bundled content
|
|
working-directory: showcase/shell-docs
|
|
run: npm run pretypecheck
|
|
# Scoped to the two setup-concept files on purpose. The whole shell-docs
|
|
# suite is not green on main, so running it here would gate every snippet
|
|
# change on unrelated failures.
|
|
- name: Check every framework states its frontend-tool requirement
|
|
working-directory: showcase/shell-docs
|
|
run: |
|
|
npm exec -- vitest run \
|
|
src/lib/__tests__/frontend-tools-setup-coverage.test.ts \
|
|
src/lib/__tests__/setup-concept-rendering.test.tsx \
|
|
src/lib/__tests__/setup-concept.test.ts
|
|
|
|
doc-tests:
|
|
runs-on: depot-ubuntu-24.04-4
|
|
timeout-minutes: 15
|
|
needs: validate-model-names
|
|
permissions:
|
|
contents: read
|
|
# id-token: write is required for Depot OIDC auth (runs-on: depot-ubuntu-*).
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
persist-credentials: false
|
|
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
- run: pnpm install --frozen-lockfile
|
|
- name: Start aimock
|
|
run: |
|
|
# aimock is pinned as a workspace dependency (@copilotkit/showcase-scripts)
|
|
# and installed from the frozen lockfile above — no ad-hoc `npm install -g`.
|
|
# The `llmock` bin is aimock's fixtures-based CLI (the package also ships an
|
|
# `aimock` bin, which is the newer config-only CLI that does NOT accept
|
|
# --fixtures). Invoke the workspace-installed bin directly from the repo
|
|
# root so the root-relative --fixtures path resolves correctly (a
|
|
# `pnpm --filter exec` would run inside showcase/scripts and break the path).
|
|
nohup ./showcase/scripts/node_modules/.bin/llmock --fixtures scripts/doc-tests/fixtures --validate-on-load > /tmp/aimock.log 2>&1 &
|
|
for i in $(seq 1 60); do
|
|
if curl -sf http://localhost:4010/health; then
|
|
echo "aimock ready"
|
|
exit 0
|
|
fi
|
|
sleep 1
|
|
done
|
|
echo "aimock failed to start. Logs:"
|
|
cat /tmp/aimock.log
|
|
exit 1
|
|
- run: pnpm tsx scripts/doc-tests/extract.ts
|
|
- run: pnpm tsx scripts/doc-tests/run.ts
|