1313
1414 strategy :
1515 matrix :
16- node-version : [22 ]
16+ node-version : [ 22 ]
1717
1818 steps :
1919 - name : Checkout code
@@ -64,10 +64,10 @@ jobs:
6464 run : |
6565 # Ensure workspace dependencies are properly linked
6666 echo "📦 Verifying workspace structure..."
67- echo "🔗 Checking ai package..."
68- [ -d "packages/ai" ] && echo "✅ ai package found" || echo "❌ ai package missing"
6967 echo "🔗 Checking core package..."
7068 [ -d "packages/core" ] && echo "✅ core package found" || echo "❌ core package missing"
69+ echo "🔗 Checking ai package..."
70+ [ -d "packages/ai" ] && echo "✅ ai package found" || echo "❌ ai package missing"
7171 echo "🔗 Checking mcp package..."
7272 [ -d "packages/mcp" ] && echo "✅ mcp package found" || echo "❌ mcp package missing"
7373 echo "🔗 Checking web package..."
7878 echo "MCP depends on core:"
7979 cat packages/mcp/package.json | grep -A 5 '"dependencies"' || echo "No dependencies section found"
8080
81- - name : Build ai package first
82- run : pnpm --filter @devlog/ai build
83-
84- - name : Verify ai build
85- run : |
86- [ -f "packages/ai/build/index.js" ] || { echo "❌ AI build failed"; exit 1; }
87- [ -f "packages/ai/build/index.d.ts" ] || { echo "❌ AI type declarations failed"; exit 1; }
88- echo "✅ AI package built successfully"
89-
9081 - name : Build core package
9182 run : pnpm --filter @devlog/core build
9283
9687 [ -f "packages/core/build/index.d.ts" ] || { echo "❌ Core type declarations failed"; exit 1; }
9788 echo "✅ Core package built successfully"
9889
90+ - name : Build ai package first
91+ run : pnpm --filter @devlog/ai build
92+
93+ - name : Verify ai build
94+ run : |
95+ [ -f "packages/ai/build/index.js" ] || { echo "❌ AI build failed"; exit 1; }
96+ [ -f "packages/ai/build/index.d.ts" ] || { echo "❌ AI type declarations failed"; exit 1; }
97+ echo "✅ AI package built successfully"
98+
9999 - name : Type-check MCP package before building
100100 run : |
101101 cd packages/mcp
@@ -109,205 +109,21 @@ jobs:
109109 - name : Build web package
110110 run : pnpm --filter @devlog/web build
111111
112- - name : Run unit tests
112+ - name : Run tests
113113 run : |
114- echo "🧪 Running unit tests for packages with test scripts..."
114+ echo "🧪 Running tests for packages with test scripts..."
115115 # Run tests for packages that have test scripts
116- pnpm --filter @devlog/ai test
117- pnpm --filter @devlog/core test
118- pnpm --filter @devlog/mcp test
119-
120- - name : Run integration tests
121- run : |
122- echo "🔗 Running integration tests..."
123- # Only run integration tests for packages that have them
124- pnpm --filter @devlog/mcp test:integration
116+ pnpm -r test:coverage
125117
126118 - name : Verify build artifacts
127119 run : |
128120 # Check that essential build artifacts exist
129- [ -f "packages/ai/build/index.js" ] || { echo "❌ AI build failed"; exit 1; }
130- [ -f "packages/ai/build/index.d.ts" ] || { echo "❌ AI type declarations failed"; exit 1; }
131121 [ -f "packages/core/build/index.js" ] || { echo "❌ Core build failed"; exit 1; }
132122 [ -f "packages/core/build/index.d.ts" ] || { echo "❌ Core type declarations failed"; exit 1; }
123+ [ -f "packages/ai/build/index.js" ] || { echo "❌ AI build failed"; exit 1; }
124+ [ -f "packages/ai/build/index.d.ts" ] || { echo "❌ AI type declarations failed"; exit 1; }
133125 [ -f "packages/mcp/build/index.js" ] || { echo "❌ MCP server build failed"; exit 1; }
134126 [ -f "packages/mcp/build/index.d.ts" ] || { echo "❌ MCP type declarations failed"; exit 1; }
135127 # Web package builds to .next directory, not build/
136128 [ -d "packages/web/.next" ] || { echo "❌ Web package build failed"; exit 1; }
137129 echo "✅ All build artifacts verified!"
138-
139- ai-cli-tests :
140- name : AI CLI Tests
141- runs-on : ubuntu-latest
142- needs : test
143-
144- steps :
145- - name : Checkout code
146- uses : actions/checkout@v4
147-
148- - name : Setup Node.js
149- uses : actions/setup-node@v4
150- with :
151- node-version : ' 20'
152-
153- - name : Setup pnpm
154- uses : pnpm/action-setup@v4
155- with :
156- version : 10.12.1
157- run_install : false
158-
159- - name : Install dependencies
160- run : pnpm install --frozen-lockfile
161-
162- - name : Build ai package
163- run : pnpm --filter @devlog/ai build
164-
165- - name : Verify ai build artifacts
166- run : |
167- [ -f "packages/ai/build/index.js" ] || { echo "❌ AI library build failed"; exit 1; }
168- [ -f "packages/ai/build/index.d.ts" ] || { echo "❌ AI type declarations failed"; exit 1; }
169- [ -f "packages/ai/build/cli/index.js" ] || { echo "❌ AI CLI build failed"; exit 1; }
170- echo "✅ AI build artifacts verified!"
171-
172- - name : Test ai CLI functionality
173- run : |
174- cd packages/ai
175- # Test help command
176- node build/cli/index.js --help
177- # Test version command if available
178- node build/cli/index.js --version || echo "Version command not available, that's ok"
179-
180- - name : Run ai unit tests
181- run : |
182- cd packages/ai
183- pnpm test
184-
185- mcp-server-tests :
186- name : MCP Server Specific Tests
187- runs-on : ubuntu-latest
188- needs : test
189-
190- steps :
191- - name : Checkout code
192- uses : actions/checkout@v4
193-
194- - name : Setup Node.js
195- uses : actions/setup-node@v4
196- with :
197- node-version : ' 20'
198-
199- - name : Setup pnpm
200- uses : pnpm/action-setup@v4
201- with :
202- version : 10.12.1
203- run_install : false
204-
205- - name : Install dependencies
206- run : pnpm install --frozen-lockfile
207-
208- - name : Build ai package first
209- run : pnpm --filter @devlog/ai build
210-
211- - name : Build core package first
212- run : pnpm --filter @devlog/core build
213-
214- - name : Build MCP server
215- run : pnpm --filter @devlog/mcp build
216-
217- - name : Verify MCP build artifacts
218- run : |
219- [ -f "packages/ai/build/index.js" ] || { echo "❌ AI build failed"; exit 1; }
220- [ -f "packages/ai/build/index.d.ts" ] || { echo "❌ AI type declarations failed"; exit 1; }
221- [ -f "packages/core/build/index.js" ] || { echo "❌ Core build failed"; exit 1; }
222- [ -f "packages/core/build/index.d.ts" ] || { echo "❌ Core type declarations failed"; exit 1; }
223- [ -f "packages/mcp/build/index.js" ] || { echo "❌ MCP server build failed"; exit 1; }
224- [ -f "packages/mcp/build/index.d.ts" ] || { echo "❌ MCP type declarations failed"; exit 1; }
225- echo "✅ MCP build artifacts verified!"
226-
227- - name : Test MCP server startup
228- run : |
229- cd packages/mcp
230- timeout 10s node build/index.js --help || echo "MCP server help command test completed"
231-
232- - name : Test MCP protocol functionality
233- run : |
234- cd packages/mcp
235- # Test basic MCP protocol initialization
236- echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}}' | timeout 10s node build/index.js || echo "MCP server protocol test completed"
237-
238- - name : Run MCP integration tests
239- run : |
240- cd packages/mcp
241- pnpm test:integration
242-
243- cross-platform :
244- name : Cross-platform Tests
245- runs-on : ${{ matrix.os }}
246- needs : test
247-
248- strategy :
249- matrix :
250- os : [ubuntu-latest, macos-latest, windows-latest]
251- node-version : [18, 20]
252- fail-fast : false
253-
254- steps :
255- - name : Checkout code
256- uses : actions/checkout@v4
257-
258- - name : Setup Node.js ${{ matrix.node-version }}
259- uses : actions/setup-node@v4
260- with :
261- node-version : ${{ matrix.node-version }}
262-
263- - name : Setup pnpm
264- uses : pnpm/action-setup@v4
265- with :
266- version : 10.12.1
267- run_install : false
268-
269- - name : Install dependencies
270- run : pnpm install --frozen-lockfile
271-
272- - name : Build packages in order
273- run : |
274- pnpm --filter @devlog/ai-chat build
275- pnpm --filter @devlog/core build
276- pnpm --filter @devlog/mcp build
277-
278- - name : Verify TypeScript compilation
279- run : |
280- echo "🔍 Verifying TypeScript compilation..."
281- cd packages/mcp && npx tsc --noEmit --skipLibCheck
282- echo "✅ TypeScript compilation verified"
283-
284- - name : Test MCP server startup (Unix)
285- if : runner.os != 'Windows'
286- run : |
287- cd packages/mcp
288- timeout 10s node build/index.js --help || echo "MCP server help test completed"
289-
290- - name : Test ai-chat CLI (Unix)
291- if : runner.os != 'Windows'
292- run : |
293- cd packages/ai-chat
294- timeout 10s node build/cli/index.js --help || echo "AI-Chat CLI help test completed"
295-
296- - name : Test MCP server startup (Windows)
297- if : runner.os == 'Windows'
298- run : |
299- cd packages/mcp
300- # Use PowerShell timeout for Windows
301- powershell -Command "& { try { `$process = Start-Process -FilePath 'node' -ArgumentList 'build/index.js', '--help' -Wait -TimeoutSec 10 -PassThru -ErrorAction SilentlyContinue; Write-Host 'MCP server help test completed' } catch { Write-Host 'MCP server help test completed with timeout' } }"
302-
303- - name : Test ai-chat CLI (Windows)
304- if : runner.os == 'Windows'
305- run : |
306- cd packages/ai-chat
307- # Use PowerShell timeout for Windows
308- powershell -Command "& { try { `$process = Start-Process -FilePath 'node' -ArgumentList 'build/cli/index.js', '--help' -Wait -TimeoutSec 10 -PassThru -ErrorAction SilentlyContinue; Write-Host 'AI-Chat CLI help test completed' } catch { Write-Host 'AI-Chat CLI help test completed with timeout' } }"
309-
310- - name : Run integration tests
311- run : |
312- cd packages/mcp
313- pnpm test:integration
0 commit comments