Repository navigation
111 lines (90 loc) · 3.44 KB
/
Copy pathci.yml
File metadata and controls
111 lines (90 loc) · 3.44 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
111
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
# ── Node.js Backend ─────────────────────────────────────────────────────────
backend-test:
name: Backend — Jest Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm ci --prefer-offline 2>/dev/null || npm install
- name: Run Jest tests
env:
NODE_ENV: test
JWT_SECRET: ci-test-secret-key-for-testing-only
MONGODB_URI: ""
ML_BACKEND_URL: http://localhost:8000
ML_HMAC_SECRET: ci-hmac-secret
run: npm test -- --passWithNoTests
# ── Next.js Frontend ─────────────────────────────────────────────────────────
frontend-typecheck:
name: Frontend — TypeScript Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: socmint
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: socmint/package-lock.json
- name: Install dependencies
run: npm ci --prefer-offline 2>/dev/null || npm install
- name: TypeScript check
env:
NEXT_PUBLIC_API_URL: http://localhost:4000
SKIP_ENV_VALIDATION: "true"
run: npx tsc --noEmit --skipLibCheck || true
# ── ML Backend — Syntax Only ─────────────────────────────────────────────────
ml-syntax:
name: ML Backend — Python Syntax Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install lightweight deps only
working-directory: ml-backend
run: |
pip install --upgrade pip
pip install fastapi pydantic uvicorn httpx rapidfuzz dnspython phonenumbers 2>/dev/null || true
- name: Syntax check all Python files
working-directory: ml-backend
run: |
find app -name "*.py" -exec python -m py_compile {} \; && echo "All Python files OK"
# ── Security Scan ───────────────────────────────────────────────────────────
security:
name: Security — Dependency Audit
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Audit backend dependencies
working-directory: backend
run: npm audit --audit-level=critical || true
- name: Audit frontend dependencies
working-directory: socmint
run: npm audit --audit-level=critical || true