Skip to content

Commit d05f5dc

Browse files
committed
integration: ci-pipeline
1 parent fe21b16 commit d05f5dc

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI - Backend (E2E Only)
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
pull_request:
7+
branches: ["*"]
8+
9+
jobs:
10+
e2e-tests:
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
postgres:
15+
image: postgres:14
16+
ports:
17+
- 5432:5432
18+
env:
19+
POSTGRES_USER: arun
20+
POSTGRES_PASSWORD: 12arun
21+
POSTGRES_DB: BrainVector
22+
options: >-
23+
--health-cmd="pg_isready -U arun -d BrainVector"
24+
--health-interval=10s
25+
--health-timeout=5s
26+
--health-retries=5
27+
28+
redis:
29+
image: redis:6.2-alpine
30+
ports:
31+
- 6379:6379
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 18
41+
cache: "npm"
42+
cache-dependency-path: backend/package-lock.json
43+
44+
- name: Install backend dependencies
45+
working-directory: backend
46+
run: npm install
47+
48+
- name: Setup Prisma
49+
working-directory: backend
50+
env:
51+
DATABASE_URL: postgres://arun:12arun@localhost:5432/BrainVector
52+
run: |
53+
npx prisma generate
54+
npx prisma migrate deploy
55+
56+
- name: Lint code
57+
working-directory: backend
58+
run: npm run lint
59+
60+
- name: Run E2E tests
61+
working-directory: backend
62+
env:
63+
DATABASE_URL: postgres://arun:12arun@localhost:5432/BrainVector
64+
NODE_ENV: test
65+
run: npm run test:e2e

0 commit comments

Comments
 (0)