add database for e2e tests in ci
This commit is contained in:
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@@ -8,8 +8,30 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
name: Lint, Check & Build
|
name: Lint, Check, Build & Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: test
|
||||||
|
POSTGRES_PASSWORD: test
|
||||||
|
POSTGRES_DB: esports_test
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: >-
|
||||||
|
--health-cmd="pg_isready -U test"
|
||||||
|
--health-interval=5s
|
||||||
|
--health-timeout=5s
|
||||||
|
--health-retries=5
|
||||||
|
|
||||||
|
env:
|
||||||
|
DATABASE_URL: postgres://test:test@localhost:5432/esports_test
|
||||||
|
BETTER_AUTH_SECRET: ci-test-secret
|
||||||
|
OSU_CLIENT_ID: '0'
|
||||||
|
OSU_CLIENT_SECRET: ci-test-secret
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -26,11 +48,17 @@ jobs:
|
|||||||
- name: Type check
|
- name: Type check
|
||||||
run: bun run check
|
run: bun run check
|
||||||
|
|
||||||
|
- name: Push DB schema
|
||||||
|
run: bun run db:push
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: bun run build
|
run: bun run build
|
||||||
|
|
||||||
- name: Install Playwright browsers
|
- name: Install Playwright browsers
|
||||||
run: bunx playwright install --with-deps chromium
|
run: bunx playwright install --with-deps chromium
|
||||||
|
|
||||||
- name: Tests
|
- name: Unit tests
|
||||||
run: bun run test
|
run: bun run test:unit --run
|
||||||
|
|
||||||
|
- name: E2E tests
|
||||||
|
run: bun run test:e2e
|
||||||
|
|||||||
Reference in New Issue
Block a user