-
Notifications
You must be signed in to change notification settings - Fork 5
147 lines (117 loc) · 3.42 KB
/
Copy pathci.yml
File metadata and controls
147 lines (117 loc) · 3.42 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
server-build:
name: Server Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: Server/package-lock.json
- name: Install dependencies
working-directory: Server
run: npm ci
- name: Generate Prisma client
working-directory: Server
run: npx prisma generate
- name: Build TypeScript
working-directory: Server
run: npm run build
- name: Run unit tests
working-directory: Server
run: npm test
server-integration:
name: Server Integration Tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: zcore_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -ptest"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: Server/package-lock.json
- name: Install dependencies
working-directory: Server
run: npm ci
- name: Generate Prisma client
working-directory: Server
run: npx prisma generate
- name: Apply migrations
working-directory: Server
run: npx prisma migrate deploy
env:
DATABASE_URL: mysql://root:test@127.0.0.1:3306/zcore_test
- name: Run integration tests
working-directory: Server
run: npm run test:integration
env:
DATABASE_URL: mysql://root:test@127.0.0.1:3306/zcore_test
JWT_SECRET: test_jwt_secret_ci
ADMIN_SECRET: test_admin_ci
mock-contract-test:
name: Mock Soroban Contract Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run mock contract tests
working-directory: Contracts/mock-score-registry
run: cargo test
lender-sdk-build:
name: Lender SDK Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install and build
working-directory: packages/lender-sdk
run: npm install && npm run build
front-build:
name: Frontend Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: Front/package-lock.json
- name: Install dependencies
working-directory: Front
run: npm ci --legacy-peer-deps
- name: Type check
working-directory: Front
run: npx tsc --noEmit
- name: Build Next.js
working-directory: Front
run: npm run build
env:
NEXT_PUBLIC_API_BASE_URL: https://zcore-api.vercel.app
NEXT_PUBLIC_STELLAR_NETWORK: testnet