Skip to content

Commit

Permalink
chore(ci): services in be ci
Browse files Browse the repository at this point in the history
  • Loading branch information
krystxf committed Oct 20, 2024
1 parent 46c0cfe commit 6730672
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
44 changes: 40 additions & 4 deletions .github/workflows/backend-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions apps/backend/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 6730672

Please sign in to comment.