Skip to content

Commit

Permalink
CI piplein 🚩
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeManSu committed Jul 7, 2024
1 parent be4ecae commit 0a18dd6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Server CI pipeline

on:
push:
branches:
- master
pull_request:
branches:
- master

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

services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
POSTGRES_DB: mango
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
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 primsa:generate

- name: Migrate database
run: npx prisma migrate deploy

- name: Run tests
env:
DATABASE_URL: postgresql://root:password@localhost:5432/mango
uses: npm test
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL="postgresql://root:password@localhost:5432/mango?schema=public"

0 comments on commit 0a18dd6

Please sign in to comment.