Merge pull request #35 from singularityworks-xyz/dev #22
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 Unit & Integration | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| jobs: | |
| unit-web: | |
| name: Unit Web | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.11" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: bun run db:gen | |
| - name: Run unit tests | |
| run: bun test --preload ./tests/config/web.setup.ts ./apps/web/src/**/*.test.ts --coverage | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-unit-web | |
| path: coverage/ | |
| retention-days: 7 | |
| - name: Upload JUnit | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: junit-unit-web | |
| path: junit.xml | |
| retention-days: 7 | |
| continue-on-error: true | |
| unit-server-and-packages: | |
| name: Unit Server & Packages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.11" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: bun run db:gen | |
| - name: Run worker unit tests | |
| run: bun test --preload ./tests/config/workers.setup.ts ./apps/workers/src/**/*.test.ts --coverage | |
| - name: Run package unit tests | |
| run: | | |
| bun test --preload ./tests/config/bun.setup.ts ./packages/ai/src/*.test.ts --coverage | |
| bun test --preload ./tests/config/bun.setup.ts ./packages/db/src/*.test.ts --coverage | |
| bun test --preload ./tests/config/bun.setup.ts ./packages/logger/src/sdk-node.test.ts --coverage | |
| bun test --preload ./tests/config/bun.setup.ts ./packages/logger/src/config.test.ts ./packages/logger/src/logger.test.ts ./packages/logger/src/tracer.test.ts ./packages/logger/src/metrics.test.ts --coverage | |
| bun test --preload ./tests/config/bun.setup.ts ./packages/native-bridge/src/*.test.ts --coverage | |
| bun test --preload ./tests/config/bun.setup.ts ./packages/yjs-shared/src/*.test.ts --coverage | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-unit-server-and-packages | |
| path: coverage/ | |
| retention-days: 7 | |
| - name: Upload JUnit | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: junit-unit-server-and-packages | |
| path: junit.xml | |
| retention-days: 7 | |
| continue-on-error: true | |
| integration-web: | |
| name: Integration Web | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: lumen_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.11" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: bun run db:gen | |
| - name: Push schema to test DB | |
| env: | |
| DATABASE_URL: postgres://test:test@localhost:5432/lumen_test | |
| run: bun run db:push | |
| - name: Run integration tests | |
| env: | |
| DATABASE_URL: postgres://test:test@localhost:5432/lumen_test | |
| run: bun test --preload ./tests/config/web.setup.ts ./apps/web/test/integration/*.test.ts | |
| integration-workers: | |
| name: Integration Workers | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: lumen_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.11" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: bun run db:gen | |
| - name: Push schema to test DB | |
| env: | |
| DATABASE_URL: postgres://test:test@localhost:5432/lumen_test | |
| run: bun run db:push | |
| - name: Run integration tests | |
| env: | |
| DATABASE_URL: postgres://test:test@localhost:5432/lumen_test | |
| run: bun test --preload ./tests/config/workers.setup.ts ./apps/workers/test/integration/*.test.ts | |
| coverage-gate: | |
| name: Coverage Gate | |
| runs-on: ubuntu-latest | |
| needs: | |
| - unit-web | |
| - unit-server-and-packages | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.11" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Download unit-web coverage | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: coverage-unit-web | |
| path: coverage | |
| - name: Download unit-server-and-packages coverage | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: coverage-unit-server-and-packages | |
| path: coverage | |
| merge-multiple: true | |
| - name: Check LCOV thresholds | |
| run: bun run scripts/testing/check-lcov-thresholds.ts |