ci: real PostgreSQL test DB with pgvector, all tests enabled
This commit is contained in:
@@ -13,9 +13,25 @@ jobs:
|
|||||||
ci:
|
ci:
|
||||||
name: Lint, Test & Build
|
name: Lint, Test & Build
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: pgvector/pgvector:pg16
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: memento_test
|
||||||
|
POSTGRES_PASSWORD: memento_test
|
||||||
|
POSTGRES_DB: memento_test
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 5s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: memento-note
|
working-directory: memento-note
|
||||||
|
env:
|
||||||
|
DATABASE_URL: "postgresql://memento_test:memento_test@localhost:5432/memento_test"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -33,13 +49,16 @@ jobs:
|
|||||||
- name: Generate Prisma client
|
- name: Generate Prisma client
|
||||||
run: npx prisma generate
|
run: npx prisma generate
|
||||||
|
|
||||||
|
- name: Setup test database
|
||||||
|
run: |
|
||||||
|
npx prisma migrate deploy
|
||||||
|
PGPASSWORD=memento_test psql -h localhost -U memento_test -d memento_test -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint -- --max-warnings 999
|
run: npm run lint
|
||||||
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
run: npm run test:unit
|
run: npm run test:unit
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
|
||||||
DATABASE_URL: "postgresql://dummy:dummy@localhost:5432/dummy"
|
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"test": "playwright test",
|
"test": "playwright test",
|
||||||
"test:ui": "playwright test --ui",
|
"test:ui": "playwright test --ui",
|
||||||
"test:headed": "playwright test --headed",
|
"test:headed": "playwright test --headed",
|
||||||
"test:unit": "vitest run --exclude 'tests/migration/**' --exclude 'tests/unit/adaptive-weighting.test.ts' --exclude 'tests/unit/embedding-validation.test.ts' --exclude 'tests/unit/rrf.test.ts' --exclude 'tests/unit/fallback.test.ts'",
|
"test:unit": "vitest run",
|
||||||
"test:unit:watch": "vitest watch",
|
"test:unit:watch": "vitest watch",
|
||||||
"test:unit:coverage": "vitest run --coverage",
|
"test:unit:coverage": "vitest run --coverage",
|
||||||
"test:migration": "vitest run tests/migration",
|
"test:migration": "vitest run tests/migration",
|
||||||
|
|||||||
Reference in New Issue
Block a user