Skip to content

Commit

Permalink
Separated build and test step 🚩
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeManSu committed Jul 7, 2024
1 parent 1673e1f commit 3e99720
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/ci-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,28 @@ on:
- master

jobs:
build-and-test:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Install dependencies
run: npm ci

- name: Generate Prisma Client
run: npm run prisma:generate

- name: Migrate database
run: npx prisma migrate deploy

test:
runs-on: ubuntu-latest

services:
Expand All @@ -27,6 +48,8 @@ jobs:
--health-timeout 5s
--health-retries 5
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -39,12 +62,6 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Generate Prisma Client
run: npm run primsa:generate

- name: Migrate database
run: npx prisma migrate deploy

- name: Run tests
env:
DATABASE_URL: postgresql://root:password@localhost:5432/mango
Expand Down

0 comments on commit 3e99720

Please sign in to comment.