Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI

on:
push:
branches: [2.0, dev, main]
pull_request:
branches: [2.0, dev, main]

jobs:
typecheck:
name: TypeScript typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "20"
- run: npm install --no-audit --no-fund
- run: npm run build

unit-tests:
name: Unit tests (no DB)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "20"
- run: npm install --no-audit --no-fund
- run: npm test
env:
# 不设 NEO4J_INTEGRATION,集成测试自动 skip
CI: "true"

integration-tests:
name: Integration tests (Neo4j 5 + APOC + GDS)
runs-on: ubuntu-latest
services:
neo4j:
image: neo4j:5.24.2
env:
NEO4J_AUTH: neo4j/graphmemory
NEO4J_PLUGINS: '["apoc", "graph-data-science"]'
NEO4J_dbms_security_procedures_unrestricted: apoc.*,gds.*
NEO4J_dbms_security_procedures_allowlist: apoc.*,gds.*
NEO4J_server_memory_heap_initial__size: 512m
NEO4J_server_memory_heap_max__size: 1G
ports:
- 7687:7687
- 7474:7474
options: >-
--health-cmd "cypher-shell -u neo4j -p graphmemory 'RETURN 1' || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 12
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "20"
- run: npm install --no-audit --no-fund
- name: Wait for Neo4j plugins (APOC/GDS) load
run: |
echo "Waiting for Neo4j + APOC + GDS to be ready..."
for i in $(seq 1 30); do
if cypher-shell -a bolt://localhost:7687 -u neo4j -p graphmemory "RETURN apoc.version() AS v" 2>/dev/null; then
echo "APOC ready"
break
fi
echo " attempt $i/30: APOC not yet loaded..."
sleep 5
done
cypher-shell -a bolt://localhost:7687 -u neo4j -p graphmemory "CALL gds.version() YIELD version RETURN version" || echo "GDS not ready (tests will use fallback path)"
- name: Run integration tests
run: npm test
env:
NEO4J_INTEGRATION: "1"
CI: "true"

shellcheck:
name: Shell script syntax check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: bash -n syntax check
run: |
# 用 if/then 控制流,避免 set -e 在文件不存在时让 job 失败
status=0
for f in setup-graph-memory-pro.sh migrate/install-wsl.sh; do
if [[ -f "$f" ]]; then
if bash -n "$f"; then
echo "OK: $f"
else
echo "FAIL: $f"
status=1
fi
else
echo "SKIP (not in repo): $f"
fi
done
exit $status
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ dist/
.DS_Store
*.log
package-lock.json
.omo/
/migrate/staging
*.pyc
Loading