-
Notifications
You must be signed in to change notification settings - Fork 5
103 lines (84 loc) · 2.73 KB
/
ci.yml
File metadata and controls
103 lines (84 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI - Build & Validate
on:
pull_request:
branches: [develop, main]
push:
branches: [develop, main, 'feature/**', 'fix/**', 'hotfix/**', 'chore/**', 'refactor/**', 'docs/**']
jobs:
# ==========================================
# Backend Build Check
# ==========================================
backend-build:
name: Backend Build Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Generate Prisma Client
run: npx prisma generate
- name: Check for syntax errors
run: node --check src/app.js
- name: Build Docker image (validation)
run: docker build -t moduwa-backend:test .
# ==========================================
# FastAPI Build Check
# ==========================================
fastapi-build:
name: FastAPI Build Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'fastapi-server/requirements.txt'
- name: Install dependencies
working-directory: ./fastapi-server
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Check Python syntax
working-directory: ./fastapi-server
run: python -m py_compile main.py
- name: Build Docker image (validation)
working-directory: ./fastapi-server
run: docker build -t moduwa-fastapi:test .
# ==========================================
# Docker Compose Validation
# ==========================================
docker-compose-check:
name: Docker Compose Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create dummy .env file
run: |
cat > .env << EOF
OPENAI_API_KEY=test-key
KAKAO_CLIENT_ID=test-id
KAKAO_REDIRECT_URI=http://localhost:3000
KAKAO_CLIENT_SECRET=test-secret
DATABASE_URL=mysql://test:test@localhost:3306/test
REDIS_URL=redis://localhost:6379
JWT_SECRET=test-jwt-secret
NODE_ENV=test
EOF
- name: Validate docker-compose.yml
run: docker compose config
- name: Check if services can start
run: |
docker compose up -d mysql redis
sleep 10
docker compose ps
docker compose down -v