Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 3de7cbd

Browse files
Add GitHub Actions CI: tests on Linux + Windows, MCP smoke test
2 jobs × 2 platforms: - test: npm ci → build → 731 tests on ubuntu + windows × Node 18 + 20 - mcp-smoke: npm install from registry → import check → MCP stdio handshake README badge now links to live CI status instead of static count. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2463b27 commit 3de7cbd

2 files changed

Lines changed: 93 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest]
15+
node-version: ['18', '20']
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build
27+
run: npm run build
28+
29+
- name: Run tests
30+
run: npm test
31+
32+
mcp-smoke:
33+
strategy:
34+
matrix:
35+
os: [ubuntu-latest, windows-latest]
36+
runs-on: ${{ matrix.os }}
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: '20'
42+
43+
- name: Install from npm (simulates real user)
44+
run: npm install flowscript-core
45+
46+
- name: Verify import
47+
run: node -e "const { Memory } = require('flowscript-core'); console.log('Import OK, Memory:', typeof Memory);"
48+
49+
- name: MCP server stdio handshake
50+
shell: node {0}
51+
run: |
52+
const { spawn } = require('child_process');
53+
const path = require('path');
54+
55+
const mcp = path.join('node_modules', 'flowscript-core', 'bin', 'flowscript-mcp');
56+
const proc = spawn('node', [mcp, './test-memory.json'], {
57+
stdio: ['pipe', 'pipe', 'pipe']
58+
});
59+
60+
const msg = JSON.stringify({
61+
jsonrpc: '2.0', id: 1, method: 'initialize',
62+
params: {
63+
protocolVersion: '2025-03-26',
64+
capabilities: {},
65+
clientInfo: { name: 'ci-test', version: '1.0' }
66+
}
67+
});
68+
69+
let output = '';
70+
proc.stdout.on('data', (data) => { output += data.toString(); });
71+
72+
setTimeout(() => {
73+
proc.stdin.write(msg + '\n');
74+
setTimeout(() => {
75+
const lines = output.trim().split('\n').filter(Boolean);
76+
if (lines.length === 0) {
77+
console.error('No response from MCP server');
78+
process.exit(1);
79+
}
80+
const data = JSON.parse(lines[lines.length - 1]);
81+
if (!data.result) {
82+
console.error('Bad response:', JSON.stringify(data));
83+
process.exit(1);
84+
}
85+
const info = data.result.serverInfo || {};
86+
console.log(`MCP server OK: ${info.name} v${info.version}`);
87+
console.log(`Platform: ${process.platform}`);
88+
console.log(`Node: ${process.version}`);
89+
proc.kill();
90+
console.log('PASS: MCP stdio handshake works');
91+
}, 2000);
92+
}, 1000);

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<p align="center"><strong>Structured reasoning memory for AI agents. Five queries no vector store can answer: <code>why()</code>, <code>tensions()</code>, <code>blocked()</code>, <code>alternatives()</code>, <code>whatIf()</code>. Your agent builds the graph during normal work. You query it.</strong></p>
88

9-
[![Tests](https://img.shields.io/badge/tests-731%20passing-brightgreen)](https://github.com/phillipclapham/flowscript) [![npm](https://img.shields.io/npm/v/flowscript-core)](https://www.npmjs.com/package/flowscript-core) [![PyPI](https://img.shields.io/pypi/v/flowscript-agents)](https://pypi.org/project/flowscript-agents/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Website](https://img.shields.io/badge/demo-flowscript.org-purple)](https://flowscript.org)
9+
[![Tests](https://github.com/phillipclapham/flowscript/actions/workflows/test.yml/badge.svg)](https://github.com/phillipclapham/flowscript/actions/workflows/test.yml) [![npm](https://img.shields.io/npm/v/flowscript-core)](https://www.npmjs.com/package/flowscript-core) [![PyPI](https://img.shields.io/pypi/v/flowscript-agents)](https://pypi.org/project/flowscript-agents/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Website](https://img.shields.io/badge/demo-flowscript.org-purple)](https://flowscript.org)
1010

1111
---
1212

0 commit comments

Comments
 (0)