-
Notifications
You must be signed in to change notification settings - Fork 1
207 lines (171 loc) · 6.84 KB
/
ci.yml
File metadata and controls
207 lines (171 loc) · 6.84 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# CI workflow: lint, build, and test all packages
#
# Triggers:
# - Pull requests to main or develop
# - Pushes to develop
name: CI
on:
pull_request:
branches:
- main
- develop
push:
branches:
- develop
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# ──────────────────────────────────────────────────────────────────
# Python server (memorylayer-core-python)
# ──────────────────────────────────────────────────────────────────
test-python-server:
name: "Python: memorylayer-server"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install package with dev, context, and observability extras
working-directory: memorylayer-core-python
# ``observability`` pulls in opentelemetry-* — required by
# ``tests/unit/test_tenant_tag_middleware.py`` which imports
# ``opentelemetry.trace`` unconditionally.
run: pip install -e ".[dev,context,observability]"
- name: Lint with ruff
working-directory: memorylayer-core-python
run: ruff check .
- name: Check formatting with ruff
working-directory: memorylayer-core-python
run: ruff format --check .
- name: Run tests
working-directory: memorylayer-core-python
run: pytest tests/ -m "not slow and not integration and not llm and not llm_quality" -x
# ──────────────────────────────────────────────────────────────────
# Python SDK (memorylayer-sdk-python)
# ──────────────────────────────────────────────────────────────────
test-python-sdk:
name: "Python: memorylayer-client"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install package with dev extras
working-directory: memorylayer-sdk-python
run: pip install -e ".[dev]"
- name: Lint with ruff
working-directory: memorylayer-sdk-python
run: ruff check .
- name: Check formatting with ruff
working-directory: memorylayer-sdk-python
run: ruff format --check .
- name: Run tests
working-directory: memorylayer-sdk-python
run: pytest tests/ -x
# ──────────────────────────────────────────────────────────────────
# TypeScript packages — three-tier dep chain:
#
# memorylayer-sdk-typescript (root; no internal deps)
# └── memorylayer-mcp-typescript (file:../memorylayer-sdk-typescript)
# └── memorylayer-opencode-plugin (file:../memorylayer-mcp-typescript)
#
# Each tier installs, builds, and runs its own tests when present, then
# uploads its dist/ as an artifact for downstream consumers.
# ──────────────────────────────────────────────────────────────────
test-typescript-sdk:
name: "TypeScript: memorylayer-sdk"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: memorylayer-sdk-typescript/package-lock.json
- name: Install dependencies
working-directory: memorylayer-sdk-typescript
run: npm ci
- name: Build
working-directory: memorylayer-sdk-typescript
run: npm run build
- name: Run tests
working-directory: memorylayer-sdk-typescript
run: npm test
- name: Upload SDK build artifacts
uses: actions/upload-artifact@v4
with:
name: memorylayer-sdk-dist
path: memorylayer-sdk-typescript/dist/
retention-days: 1
test-typescript-mcp:
name: "TypeScript: memorylayer-mcp-server"
needs: test-typescript-sdk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: memorylayer-mcp-typescript/package-lock.json
- name: Download SDK build artifacts
uses: actions/download-artifact@v4
with:
name: memorylayer-sdk-dist
path: memorylayer-sdk-typescript/dist/
- name: Install dependencies
working-directory: memorylayer-mcp-typescript
run: npm ci
- name: Build
working-directory: memorylayer-mcp-typescript
run: npm run build
- name: Run tests
working-directory: memorylayer-mcp-typescript
run: npm test
- name: Upload MCP build artifacts
uses: actions/upload-artifact@v4
with:
name: memorylayer-mcp-dist
path: memorylayer-mcp-typescript/dist/
retention-days: 1
test-typescript-plugins:
name: "TypeScript: ${{ matrix.package.name }}"
needs: test-typescript-mcp
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- { dir: memorylayer-opencode-plugin, name: memorylayer-opencode-plugin }
- { dir: memorylayer-cc-plugin, name: memorylayer-cc-plugin }
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: ${{ matrix.package.dir }}/package-lock.json
- name: Download SDK build artifacts
uses: actions/download-artifact@v4
with:
name: memorylayer-sdk-dist
path: memorylayer-sdk-typescript/dist/
- name: Download MCP build artifacts
uses: actions/download-artifact@v4
with:
name: memorylayer-mcp-dist
path: memorylayer-mcp-typescript/dist/
- name: Install dependencies
working-directory: ${{ matrix.package.dir }}
run: npm ci
- name: Build
working-directory: ${{ matrix.package.dir }}
run: npm run build
- name: Run tests (if present)
working-directory: ${{ matrix.package.dir }}
run: npm test --if-present