feat: add memory prune command #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff | |
| - name: Lint with ruff | |
| run: ruff check src/ tests/ | |
| - name: Format check with ruff | |
| run: ruff format --check src/ tests/ | |
| test-unit: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package + test deps | |
| run: pip install -e '.[mcp]' pytest pytest-cov | |
| - name: Verify CLI entry point | |
| run: memory --version | |
| - name: Verify imports | |
| run: | | |
| python -c "from ai_memory_protocol import __version__; print(f'Version: {__version__}')" | |
| python -c "from ai_memory_protocol.cli import build_parser; build_parser()" | |
| python -c "from ai_memory_protocol.engine import find_workspace" | |
| python -c "from ai_memory_protocol.formatter import format_brief" | |
| python -c "from ai_memory_protocol.rst import generate_rst_directive" | |
| python -c "from ai_memory_protocol.config import TYPE_FILES" | |
| python -c "from ai_memory_protocol.mcp_server import create_mcp_server; create_mcp_server()" | |
| - name: Run unit tests | |
| run: pytest tests/ -v -m "not integration" --cov=ai_memory_protocol --cov-report=term-missing --cov-report=html | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: htmlcov/ | |
| test-integration: | |
| runs-on: ubuntu-latest | |
| needs: [test-unit] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install package | |
| run: pip install -e '.[mcp]' pytest pytest-timeout | |
| - name: Run integration tests | |
| run: pytest tests/ -v -m integration --timeout=120 | |
| continue-on-error: true | |
| - name: Run workflow smoke test | |
| run: | | |
| memory init /tmp/test-memory --name "CI Test" --install | |
| memory --dir /tmp/test-memory add fact "CI test fact" \ | |
| --tags "topic:ci,tier:test" \ | |
| --confidence high \ | |
| --body "This is a test fact created during CI" \ | |
| --rebuild | |
| memory --dir /tmp/test-memory recall ci --format brief | |
| memory --dir /tmp/test-memory get FACT_ci_test_fact | |
| memory --dir /tmp/test-memory tags | |
| memory --dir /tmp/test-memory list | |
| test-mcp: | |
| runs-on: ubuntu-latest | |
| needs: [test-unit] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install package with MCP extras | |
| run: pip install -e '.[mcp]' pytest | |
| - name: Verify MCP server imports | |
| run: | | |
| python -c "from ai_memory_protocol.mcp_server import create_mcp_server; create_mcp_server()" | |
| python -c "from ai_memory_protocol.mcp_server import TOOLS; print(f'{len(TOOLS)} MCP tools registered')" | |
| - name: Run MCP tests | |
| run: pytest tests/test_mcp_server.py -v |