Skip to content

Commit c16455d

Browse files
authored
Merge pull request #5 from Layau-code/feature/stats-ui-demo
feature/stats-ui-demo
2 parents 192c180 + 1367250 commit c16455d

File tree

4 files changed

+329
-1028
lines changed

4 files changed

+329
-1028
lines changed

.github/workflows/test-build.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Test Build
2+
3+
on:
4+
pull_request:
5+
branches: [master, main, develop]
6+
push:
7+
branches: [feature/stats-ui-demo]
8+
9+
jobs:
10+
test-build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# 1. 检出代码
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
# 2. 设置 Node.js 环境
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
cache-dependency-path: web/package-lock.json
25+
26+
# 3. 安装前端依赖
27+
- name: Install Frontend Dependencies
28+
run: |
29+
cd web
30+
npm ci --production=false
31+
32+
# 4. 构建前端
33+
- name: Build Frontend
34+
run: |
35+
cd web
36+
npm run build
37+
env:
38+
VITE_SHORT_BASE: "https://example.com"
39+
VITE_API_BASE: "https://api.example.com"
40+
41+
# 5. 设置 Java 环境
42+
- name: Setup Java
43+
uses: actions/setup-java@v4
44+
with:
45+
distribution: 'temurin'
46+
java-version: '17'
47+
cache: 'maven'
48+
49+
# 6. 运行后端测试
50+
- name: Run Backend Tests
51+
run: mvn clean test
52+
env:
53+
APP_DOMAIN: "https://example.com"
54+
DB_PASSWORD: "test"
55+
JWT_SECRET: "test-secret"
56+
REDIS_PASSWORD: "test-redis"
57+
58+
# 7. 简单编译检查(不实际打包)
59+
- name: Compile Backend
60+
run: mvn compile -q
61+
env:
62+
APP_DOMAIN: "https://example.com"
63+
DB_PASSWORD: "test"
64+
JWT_SECRET: "test-secret"
65+
REDIS_PASSWORD: "test-redis"
66+
67+
# 8. 验证构建产物
68+
- name: Verify Build Output
69+
run: |
70+
echo "✅ 前端构建验证"
71+
ls -la web/dist/
72+
echo "✅ 后端编译验证"
73+
ls -la target/classes/

0 commit comments

Comments
 (0)