Skip to content

Replace sorted sets with Redis Search index for session listing (fixes #121) #534

Replace sorted sets with Redis Search index for session listing (fixes #121)

Replace sorted sets with Redis Search index for session listing (fixes #121) #534

name: Agent Memory Client CI
on:
push:
branches: [main]
tags:
- 'client/v*.*.*'
- 'client-java/v*.*.*'
- 'client-js/v*.*.*'
pull_request:
branches: [main]
jobs:
test-java:
name: Test (Java ${{ matrix.java-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: ["17", "21"]
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run tests
working-directory: agent-memory-client/agent-memory-client-java
run: ./gradlew test
- name: Build
working-directory: agent-memory-client/agent-memory-client-java
run: ./gradlew build
test-js:
name: Test (Node.js ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ["20", "22"]
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
working-directory: agent-memory-client/agent-memory-client-js
run: npm ci
- name: Run tests with coverage
working-directory: agent-memory-client/agent-memory-client-js
run: npm run test:coverage -- --run
- name: Build
working-directory: agent-memory-client/agent-memory-client-js
run: npm run build
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
working-directory: agent-memory-client
run: uv sync --extra dev
- name: Run pre-commit
run: |
uv run pre-commit run --all-files
- name: Run tests
working-directory: agent-memory-client
run: uv run pytest tests/ --cov=agent_memory_client --cov-report=xml
publish-testpypi:
name: Publish to TestPyPI
needs: test
if: startsWith(github.ref, 'refs/tags/client/') && contains(github.ref, '-test')
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
working-directory: agent-memory-client
run: python -m build
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: agent-memory-client/dist/
publish-pypi:
name: Publish to PyPI
needs: test
if: startsWith(github.ref, 'refs/tags/client/') && !contains(github.ref, '-test')
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
working-directory: agent-memory-client
run: python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: agent-memory-client/dist/
publish-npm:
name: Publish to npm
needs: test-js
if: startsWith(github.ref, 'refs/tags/client-js/') && !contains(github.ref, '-test')
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
working-directory: agent-memory-client/agent-memory-client-js
run: npm ci
- name: Build
working-directory: agent-memory-client/agent-memory-client-js
run: npm run build
- name: Publish to npm
working-directory: agent-memory-client/agent-memory-client-js
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-maven:
name: Publish to Maven Central
needs: test-java
if: startsWith(github.ref, 'refs/tags/client-java/') && !contains(github.ref, '-test')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/client-java/v}" >> $GITHUB_OUTPUT
- name: Build and publish
working-directory: agent-memory-client/agent-memory-client-java
run: ./gradlew publish -Pversion=${{ steps.version.outputs.VERSION }}
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
# Tag Format Guide:
# Python Client:
# - For TestPyPI (testing): client/v1.0.0-test
# - For PyPI (production): client/v1.0.0
#
# Java Client:
# - For Maven Central (production): client-java/v1.0.0
#
# JavaScript/TypeScript Client:
# - For npm (production): client-js/v1.0.0
#
# Use the script: python scripts/tag_and_push_client.py --test (for TestPyPI)
# python scripts/tag_and_push_client.py (for PyPI)
#
# Alternative: This project uses trusted publishing, but you can use API Token
# Authentication (if trusted publishing doesn't work).
#
# To do so, uncomment the sections below and add these secrets to your repository:
# - TEST_PYPI_API_TOKEN (for TestPyPI)
# - PYPI_API_TOKEN (for PyPI)
# - NPM_TOKEN (for npm)
# - GPG_SIGNING_KEY, GPG_SIGNING_PASSWORD, OSSRH_USERNAME, OSSRH_PASSWORD (for Maven Central)
#
# For TestPyPI job, replace the publish step with:
# - name: Publish package to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
# packages-dir: agent-memory-client/dist/
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
#
# For PyPI job, replace the publish step with:
# - name: Publish package to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: agent-memory-client/dist/
# password: ${{ secrets.PYPI_API_TOKEN }}