* move db * refactor db import * refactor eval types * fix tests * fix tests * fix tests * fix db migration issues * fix docker issue * fix tests * update alias * fix tests * update db test for client and server * refactor db * update codecov * update codecov * update codecov * add docker pr comments
130 lines
3.1 KiB
YAML
130 lines
3.1 KiB
YAML
name: Test CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
# Package tests - using each package's own test script
|
|
test-packages:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
package: [file-loaders, prompts, model-runtime, web-crawler, electron-server-ipc]
|
|
|
|
name: Test package ${{ matrix.package }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
|
|
- name: Install bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: ${{ secrets.BUN_VERSION }}
|
|
|
|
- name: Install deps
|
|
run: bun i
|
|
|
|
- name: Test ${{ matrix.package }} package with coverage
|
|
run: pnpm --filter @lobechat/${{ matrix.package }} test:coverage
|
|
|
|
- name: Upload ${{ matrix.package }} coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./packages/${{ matrix.package }}/coverage/lcov.info
|
|
flags: packages/${{ matrix.package }}
|
|
|
|
# App tests
|
|
test-website:
|
|
name: Test Website
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Install bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: ${{ secrets.BUN_VERSION }}
|
|
|
|
- name: Install deps
|
|
run: bun i
|
|
|
|
- name: Test App Coverage
|
|
run: bun run test-app:coverage
|
|
|
|
- name: Upload App Coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./coverage/app/lcov.info
|
|
flags: app
|
|
|
|
test-databsae:
|
|
name: Test Database
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: paradedb/paradedb:latest
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Install bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: ${{ secrets.BUN_VERSION }}
|
|
|
|
- name: Install deps
|
|
run: bun i
|
|
|
|
- name: Lint
|
|
run: bun run lint
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
|
|
- name: Test Coverage
|
|
run: pnpm --filter @lobechat/database test:coverage
|
|
env:
|
|
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
|
DATABASE_DRIVER: node
|
|
NEXT_PUBLIC_SERVICE_MODE: server
|
|
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
|
S3_PUBLIC_DOMAIN: https://example.com
|
|
APP_URL: https://home.com
|
|
|
|
- name: Upload Database coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./packages/database/coverage/lcov.info
|
|
flags: database
|