diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 44246cc..ee4024d 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -4,10 +4,28 @@ on: push jobs: ci: - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_USER: postgres_user + POSTGRES_PASSWORD: postgres_password + POSTGRES_DB: metro-now + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - name: Check out code @@ -47,3 +65,21 @@ jobs: run: | cd apps/backend pnpm types:check + + - name: Run migrations + run: | + cd apps/backend + cp .env.example .env + pnpm prisma:migrate:dev + + - name: Run seeds + run: | + cd apps/backend + cp .env.example .env + pnpm prisma:seed + + - name: Test e2e + run: | + cd apps/backend + cp .env.example .env + pnpm test:e2e diff --git a/apps/backend/.env.local.example b/apps/backend/.env.local.example index 99b8e9c..66c2356 100644 --- a/apps/backend/.env.local.example +++ b/apps/backend/.env.local.example @@ -2,8 +2,8 @@ GOLEMIO_API_KEY= # postgres -POSTGRES_USER=pg_user -POSTGRES_PASSWORD=pg_password +POSTGRES_USER=postgres_user +POSTGRES_PASSWORD=postgres_password POSTGRES_DB=metro-now