mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
4d22c398c6
Signed-off-by: phernandez <paul@basicmachines.co>
295 lines
6.9 KiB
YAML
295 lines
6.9 KiB
YAML
name: Tests
|
|
|
|
concurrency:
|
|
group: bm-ci-${{ github.workflow }}-${{ github.repository }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
# Trigger: PR branch pushes already publish commit statuses that show up on the PR.
|
|
# Why: running the full matrix on both push and pull_request doubles CI time for the
|
|
# exact same branch head commit.
|
|
# Outcome: each branch push runs the test suite once, including PR updates.
|
|
push:
|
|
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
|
|
|
jobs:
|
|
static-checks:
|
|
name: Static Checks (Python 3.12)
|
|
timeout-minutes: 20
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Python 3.12
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.12"
|
|
cache: "pip"
|
|
|
|
- name: Install uv
|
|
run: |
|
|
pip install uv
|
|
|
|
- uses: extractions/setup-just@v4
|
|
|
|
- name: Create virtual env
|
|
run: |
|
|
uv venv
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv pip install -e ".[dev]"
|
|
|
|
- name: Run type checks
|
|
run: |
|
|
just typecheck
|
|
|
|
- name: Run linting
|
|
run: |
|
|
just lint
|
|
|
|
test-sqlite-unit:
|
|
name: Test SQLite Unit (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
timeout-minutes: 45
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
python-version: "3.12"
|
|
- os: ubuntu-latest
|
|
python-version: "3.13"
|
|
- os: ubuntu-latest
|
|
python-version: "3.14"
|
|
- os: windows-latest
|
|
python-version: "3.12"
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
|
|
- name: Install uv
|
|
run: |
|
|
pip install uv
|
|
|
|
- uses: extractions/setup-just@v4
|
|
|
|
- name: Create virtual env
|
|
run: |
|
|
uv venv
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv pip install -e ".[dev]"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
just test-unit-sqlite
|
|
|
|
test-sqlite-integration:
|
|
name: Test SQLite Integration (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
timeout-minutes: 45
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
python-version: "3.12"
|
|
- os: ubuntu-latest
|
|
python-version: "3.13"
|
|
- os: ubuntu-latest
|
|
python-version: "3.14"
|
|
- os: windows-latest
|
|
python-version: "3.12"
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
|
|
- name: Install uv
|
|
run: |
|
|
pip install uv
|
|
|
|
- uses: extractions/setup-just@v4
|
|
|
|
- name: Create virtual env
|
|
run: |
|
|
uv venv
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv pip install -e ".[dev]"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
just test-int-sqlite
|
|
|
|
test-postgres-unit:
|
|
name: Test Postgres Unit (Python ${{ matrix.python-version }})
|
|
timeout-minutes: 60
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- python-version: "3.12"
|
|
- python-version: "3.13"
|
|
- python-version: "3.14"
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
env:
|
|
POSTGRES_USER: basic_memory_user
|
|
POSTGRES_PASSWORD: dev_password
|
|
POSTGRES_DB: basic_memory_test
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U basic_memory_user -d basic_memory_test"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
env:
|
|
BASIC_MEMORY_TEST_POSTGRES_URL: postgresql://basic_memory_user:dev_password@127.0.0.1:5432/basic_memory_test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
|
|
- name: Install uv
|
|
run: |
|
|
pip install uv
|
|
|
|
- uses: extractions/setup-just@v4
|
|
|
|
- name: Create virtual env
|
|
run: |
|
|
uv venv
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv pip install -e ".[dev]"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
just test-unit-postgres
|
|
|
|
test-postgres-integration:
|
|
name: Test Postgres Integration (Python ${{ matrix.python-version }})
|
|
timeout-minutes: 45
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- python-version: "3.12"
|
|
- python-version: "3.13"
|
|
- python-version: "3.14"
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
env:
|
|
POSTGRES_USER: basic_memory_user
|
|
POSTGRES_PASSWORD: dev_password
|
|
POSTGRES_DB: basic_memory_test
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U basic_memory_user -d basic_memory_test"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
env:
|
|
BASIC_MEMORY_TEST_POSTGRES_URL: postgresql://basic_memory_user:dev_password@127.0.0.1:5432/basic_memory_test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
|
|
- name: Install uv
|
|
run: |
|
|
pip install uv
|
|
|
|
- uses: extractions/setup-just@v4
|
|
|
|
- name: Create virtual env
|
|
run: |
|
|
uv venv
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv pip install -e ".[dev]"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
just test-int-postgres
|
|
|
|
test-semantic:
|
|
name: Test Semantic (Python 3.12)
|
|
timeout-minutes: 45
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Python 3.12
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.12"
|
|
cache: "pip"
|
|
|
|
- name: Install uv
|
|
run: |
|
|
pip install uv
|
|
|
|
- uses: extractions/setup-just@v4
|
|
|
|
- name: Create virtual env
|
|
run: |
|
|
uv venv
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv pip install -e ".[dev]"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
just test-semantic
|