555e282cc4
pi-agent-plugin checks / lint (push) Has been cancelled
pi-agent-plugin checks / test (20) (push) Has been cancelled
pi-agent-plugin checks / test (22) (push) Has been cancelled
pi-agent-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / check_changes (push) Has been cancelled
TypeScript SDK CI / changelog_check (push) Has been cancelled
ci / changelog_check (push) Has been cancelled
ci / check_changes (push) Has been cancelled
ci / build_mem0 (3.10) (push) Has been cancelled
ci / build_mem0 (3.11) (push) Has been cancelled
ci / build_mem0 (3.12) (push) Has been cancelled
CLI Node CI / lint (push) Has been cancelled
CLI Node CI / test (20) (push) Has been cancelled
CLI Node CI / test (22) (push) Has been cancelled
CLI Node CI / build (push) Has been cancelled
CLI Python CI / lint (push) Has been cancelled
CLI Python CI / test (3.10) (push) Has been cancelled
CLI Python CI / test (3.11) (push) Has been cancelled
CLI Python CI / test (3.12) (push) Has been cancelled
CLI Python CI / build (push) Has been cancelled
openclaw checks / lint (push) Has been cancelled
openclaw checks / test (20) (push) Has been cancelled
openclaw checks / test (22) (push) Has been cancelled
openclaw checks / build (push) Has been cancelled
opencode-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (22) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (22) (push) Has been cancelled
147 lines
4.3 KiB
YAML
147 lines
4.3 KiB
YAML
name: TypeScript SDK CI
|
|
|
|
# On PRs this is invoked by ci-gate.yml (the single required check);
|
|
# push-to-main runs remain standalone.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'mem0-ts/**'
|
|
- '.github/workflows/ts-sdk-ci.yml'
|
|
workflow_call:
|
|
|
|
jobs:
|
|
check_changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
ts_sdk_changed: ${{ steps.filter.outputs.ts_sdk }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
ts_sdk:
|
|
- 'mem0-ts/**'
|
|
|
|
changelog_check:
|
|
needs: check_changes
|
|
if: github.event_name == 'pull_request' && needs.check_changes.outputs.ts_sdk_changed == 'true'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Require CHANGELOG entry when SDK version changes
|
|
env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
base_version=$(git show "$BASE_SHA:mem0-ts/package.json" 2>/dev/null | jq -r .version || echo "")
|
|
head_version=$(jq -r .version mem0-ts/package.json)
|
|
|
|
echo "Base version: ${base_version:-<unknown>}"
|
|
echo "Head version: $head_version"
|
|
|
|
if [ -z "$base_version" ] || [ "$base_version" = "$head_version" ]; then
|
|
echo "mem0-ts/package.json version unchanged — no CHANGELOG entry required."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Detected version bump ${base_version} -> ${head_version}. Checking docs/changelog/sdk.mdx…"
|
|
|
|
if git diff --name-only "$BASE_SHA" "$HEAD_SHA" -- docs/changelog/sdk.mdx | grep -q .; then
|
|
echo "Changelog update present in docs/changelog/sdk.mdx ✅"
|
|
else
|
|
echo "::error file=mem0-ts/package.json::mem0-ts/package.json version changed from ${base_version} to ${head_version} but docs/changelog/sdk.mdx was not updated in this PR. Add a new <Update> entry under the TypeScript tab for v${head_version}."
|
|
exit 1
|
|
fi
|
|
|
|
build_ts_sdk:
|
|
needs: check_changes
|
|
if: needs.check_changes.outputs.ts_sdk_changed == 'true'
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [20, 22]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'pnpm'
|
|
cache-dependency-path: mem0-ts/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
working-directory: mem0-ts
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
working-directory: mem0-ts
|
|
run: npx prettier --check .
|
|
|
|
- name: Build
|
|
working-directory: mem0-ts
|
|
run: pnpm run build
|
|
|
|
- name: Run unit tests
|
|
working-directory: mem0-ts
|
|
run: pnpm run test:unit
|
|
|
|
- name: Verify package exports
|
|
working-directory: mem0-ts
|
|
run: |
|
|
node -e "const m = require('./dist/index.js'); console.log('Client exports:', Object.keys(m).length)"
|
|
node -e "const m = require('./dist/oss/index.js'); console.log('OSS exports:', Object.keys(m).length)"
|
|
|
|
- name: Upload coverage
|
|
if: matrix.node-version == 20
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-report
|
|
path: mem0-ts/coverage/
|
|
|
|
integration_ts_sdk:
|
|
needs: build_ts_sdk
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
max-parallel: 1
|
|
matrix:
|
|
node-version: [20, 22]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'pnpm'
|
|
cache-dependency-path: mem0-ts/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
working-directory: mem0-ts
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build
|
|
working-directory: mem0-ts
|
|
run: pnpm run build
|
|
|
|
- name: Run integration tests (with cleanup)
|
|
working-directory: mem0-ts
|
|
env:
|
|
MEM0_API_KEY: ${{ secrets.MEM0_API_KEY }}
|
|
run: pnpm run test:integration
|