Repository navigation
164 lines (155 loc) · 6.59 KB
/
Copy pathcommunity_code.yml
File metadata and controls
164 lines (155 loc) · 6.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# CI for the unmaintained samples under samples/community. The folder is
# self-contained: its samples depend on the published @a2ui/* (npm) and
# a2ui-agent-sdk (PyPI) packages rather than on the monorepo workspace. The
# one exception is @a2ui/catalog-mcp, which is not published yet: the MCP
# samples alias it, with the @a2ui/lit and @a2ui/web_core builds it depends
# on, to the monorepo dist/ directories built below.
name: Community Code CI
on:
push:
branches: [main]
paths:
- "samples/community/**"
- "typescript/catalogs/**"
- "typescript/core/web_core/**"
- "typescript/renderers/lit/**"
- ".github/workflows/community_code.yml"
pull_request:
paths:
- "samples/community/**"
- "typescript/catalogs/**"
- "typescript/core/web_core/**"
- "typescript/renderers/lit/**"
- ".github/workflows/community_code.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
web:
runs-on: ubuntu-latest
defaults:
run:
working-directory: samples/community
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
- run: corepack enable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: "yarn"
cache-dependency-path: |
yarn.lock
samples/community/yarn.lock
- name: Build @a2ui/catalog-mcp and @a2ui/lit from the monorepo workspace
# TODO(https://github.com/a2ui-project/a2ui/issues/1698): remove once
# @a2ui/catalog-mcp is published and the MCP samples install it from npm.
working-directory: .
run: |
yarn install --immutable
yarn workspace @a2ui/catalog-mcp run build
yarn workspace @a2ui/lit run build
- name: Install dependencies
run: yarn install --immutable
- name: Build web samples (Angular a2a-chat-canvas + orchestrator, Lit mcp-apps + personalized_learning)
run: yarn build:web
- name: Build custom-lit-components (type-check + bundle verification pages)
# Kept as its own step rather than folded into the build:web chain above:
# it type-checks the custom component catalog against the published
# @a2ui/* API and bundles test/*.html, so a break there reports on its own
# instead of being masked by an earlier sample in the chain.
run: yarn workspace custom-lit-components run build
kanban-e2e:
# Playwright end-to-end tests of the Kanban showcase: the MCP server, the
# scripted agent (no model) and the Lit chat host run together, and the
# suite drives the four communication channels of the sample's README.
runs-on: ubuntu-24.04 # Playwright has no Chromium build for Ubuntu 26.04 yet
defaults:
run:
working-directory: samples/community
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
- run: corepack enable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: "yarn"
cache-dependency-path: |
yarn.lock
samples/community/yarn.lock
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Build @a2ui/catalog-mcp and @a2ui/lit from the monorepo workspace
# TODO(https://github.com/a2ui-project/a2ui/issues/1698): remove once
# @a2ui/catalog-mcp is published and the MCP samples install it from npm.
working-directory: .
run: |
yarn install --immutable
yarn workspace @a2ui/catalog-mcp run build
yarn workspace @a2ui/lit run build
- name: Install dependencies
run: yarn install --immutable
- name: Build the Kanban MCP server and chat host
run: |
yarn workspace a2ui-kanban-mcp-server run build
yarn workspace a2ui-kanban-client run build
- name: Sync the Kanban agent
run: uv sync --project mcp/a2ui-kanban/agent
- name: Install Playwright Chromium
run: yarn workspace a2ui-kanban-client exec playwright install --with-deps chromium
- name: Run the Kanban e2e tests
run: yarn workspace a2ui-kanban-client run test:e2e
- name: Upload the Playwright report
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: kanban-playwright-report
path: samples/community/mcp/a2ui-kanban/client/playwright-report
retention-days: 7
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: uv sync each agent under samples/community
# These samples are runnable apps, not publishable packages (several use a
# flat module layout with no wheel target), so --no-install-project verifies
# that their dependencies resolve and install without building each as a wheel.
run: |
set -euo pipefail
find samples/community -name pyproject.toml -not -path "*/.venv/*" -not -path "*/node_modules/*" -print0 |
while IFS= read -r -d '' manifest; do
dir="$(dirname "$manifest")"
echo "::group::uv sync $dir"
uv sync --no-install-project --project "$dir"
echo "::endgroup::"
done