-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (91 loc) · 2.67 KB
/
Copy pathci.yml
File metadata and controls
110 lines (91 loc) · 2.67 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
104
105
106
107
108
109
110
name: CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# 1. Backend Testing & Security Verification
backend-test:
name: Backend Test Suite & Security Checks
runs-on: ubuntu-latest
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: backend/package-lock.json
- name: Install Backend Dependencies
working-directory: ./backend
run: npm ci
- name: Run Backend Tests
working-directory: ./backend
env:
NODE_ENV: test
PORT: 8000
REDIS_URL: redis://localhost:6379
JWT_SECRET: test_jwt_secret_key_12345
RAZORPAY_KEY_ID: rzp_test_dummy_key_id
RAZORPAY_SECRET: test_dummy_secret
GROQ_API_KEY: test_dummy_groq_key
run: npm test
# 2. Frontend Build & Quality Checks
frontend-build:
name: Frontend Build Verification
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install Frontend Dependencies
working-directory: ./frontend
run: npm ci
- name: Build Frontend Assets
working-directory: ./frontend
env:
VITE_API_URL: http://localhost:8000
run: npm run build
# 3. Python AI Proctoring Service Syntax & Integrity Checks
python-proctoring-check:
name: Python AI Proctoring Integrity Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Validate Python Syntax
working-directory: ./backend/ai_proctoring
run: |
python -m py_compile yolo_detector.py
echo "Python syntax verified successfully"
# 4. Docker Compose Config Validation
docker-validation:
name: Docker Compose Validation
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Validate Docker Compose Config
run: |
docker compose config