|
258
|
Merge remote-tracking branch 'origin/codex/fin Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'...
|
["0 0 * * *"]
|
6
|
5
|
e2e-tests.yml
|
-2
|
refs/heads/main
|
9d69e1960ec649a49c0c6f307c0fc197f47ee4c4
|
push
|
{"ref":"refs/heads/main","befo {"ref":"refs/heads/main","before":"40dae5944f158653af8288a3f38b6c97e8ce9f06","after":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","compare_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/compare/40dae5944f158653af8288a3f38b6c97e8ce9f06...9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","commits":[{"id":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","message":"Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'\n\n# Conflicts:\n#\tfrontend/src/views/invoices/Detail.vue\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:29+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":[]},{"id":"0152aae7b8ff9440c5f4e7aad113420208e6c304","message":"Merge remote-tracking branch 'origin/codex/design-scalable-autopilot-os-architecture'\n\n# Conflicts:\n#\te2e/agents/playwright-agent/index.ts\n#\te2e/agents/playwright-agent/inspectors/index.ts\n#\te2e/agents/playwright-agent/reporters/backend-reporter.ts\n#\te2e/package.json\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/0152aae7b8ff9440c5f4e7aad113420208e6c304","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:05+08:00","added":[],"removed":[],"modified":[]},{"id":"e2587fae3d50e6ef7c30450199abd1bfc910a016","message":"test(finance): add finance mainline smoke and harden invoice detail formatting","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/e2587fae3d50e6ef7c30450199abd1bfc910a016","author":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-03-31T13:47:05+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":["frontend/src/views/invoices/Detail.vue"]},{"id":"803578ebec2d6f4c0d00335c1f5c61067112d923","message":"feat(e2e): add playwright agent mvp skeleton","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/803578ebec2d6f4c0d00335c1f5c61067112d923","author":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-03-19T19:55:36+08:00","added":["e2e/agents/playwright-agent/README.md","e2e/agents/playwright-agent/__tests__/playwright-agent.unit.test.ts","e2e/agents/playwright-agent/artifacts/artifact-writer.ts","e2e/agents/playwright-agent/auth/auth-provider.ts","e2e/agents/playwright-agent/auth/storage-state-auth.ts","e2e/agents/playwright-agent/constants/diagnosis.ts","e2e/agents/playwright-agent/constants/status.ts","e2e/agents/playwright-agent/constants/timeouts.ts","e2e/agents/playwright-agent/core/action-runner.ts","e2e/agents/playwright-agent/core/browser-manager.ts","e2e/agents/playwright-agent/core/execution-engine.ts","e2e/agents/playwright-agent/core/retry-engine.ts","e2e/agents/playwright-agent/core/session-factory.ts","e2e/agents/playwright-agent/index.ts","e2e/agents/playwright-agent/inspectors/base-inspector.ts","e2e/agents/playwright-agent/inspectors/booking-inspector.ts","e2e/agents/playwright-agent/inspectors/dashboard-inspector.ts","e2e/agents/playwright-agent/inspectors/index.ts","e2e/agents/playwright-agent/inspectors/payment-inspector.ts","e2e/agents/playwright-agent/observers/console-observer.ts","e2e/agents/playwright-agent/observers/network-observer.ts","e2e/agents/playwright-agent/observers/page-probe.ts","e2e/agents/playwright-agent/reporters/backend-reporter.ts","e2e/agents/playwright-agent/reporters/json-reporter.ts","e2e/agents/playwright-agent/resolvers/selector-resolver.ts","e2e/agents/playwright-agent/types/diagnosis.ts","e2e/agents/playwright-agent/types/execution-plan.ts","e2e/agents/playwright-agent/types/execution-result.ts","e2e/agents/playwright-agent/types/execution-step.ts","e2e/agents/playwright-agent/types/inspector.ts","e2e/agents/playwright-agent/types/runtime.ts"],"removed":[],"modified":["e2e/package.json"]}],"total_commits":0,"head_commit":{"id":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","message":"Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'\n\n# Conflicts:\n#\tfrontend/src/views/invoices/Detail.vue\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:29+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":[]},"repository":{"id":6,"owner":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"law@g-hi.com","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"name":"juhi-omni-knowledge-hub","full_name":"luoanwu/juhi-omni-knowledge-hub","description":"巨嗨全域智库 - B2B RevOps 全生命周期平台","empty":false,"private":false,"fork":false,"template":false,"mirror":false,"size":5204515,"language":"","languages_url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhi-omni-knowledge-hub/languages","html_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub","url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhi-omni-knowledge-hub","link":"","ssh_url":"git@gitea.g-hi.com:luoanwu/juhi-omni-knowledge-hub.git","clone_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub.git","original_url":"https://github.com/laoluojuhai/juhi-omni-knowledge-hub.git","website":"","stars_count":0,"forks_count":0,"watchers_count":1,"branch_count":4,"open_issues_count":0,"open_pr_counter":1,"release_counter":0,"default_branch":"main","archived":false,"created_at":"2026-02-23T23:57:52+08:00","updated_at":"2026-04-03T09:40:13+08:00","archived_at":"1970-01-01T08:00:00+08:00","permissions":{"admin":true,"push":true,"pull":true},"has_code":true,"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"all","has_releases":true,"has_packages":true,"has_actions":true,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":true,"allow_rebase_update":true,"allow_manual_merge":false,"autodetect_manual_merge":false,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":false,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","topics":[],"licenses":[]},"pusher":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"sender":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"}}...
|
name: E2E Tests
on:
# PR validation - 运行关键测试
name: E2E Tests
on:
# PR validation - 运行关键测试
pull_request:
branches: [main, develop]
paths:
- 'frontend/**'
- 'backend/**'
- 'e2e/**'
- 'package.json'
- 'pnpm-lock.yaml'
# Push to main - 运行完整测试套件
push:
branches: [main]
# 每日定时全量测试 (UTC 时间 00:00 = 北京时间 08:00)
schedule:
- cron: '0 0 * * *'
# 手动触发
workflow_dispatch:
inputs:
test_suite:
description: 'Test suite to run'
required: true
default: 'all'
type: choice
options:
- all
- critical
- business-flows
- visual-regression
- performance
env:
NODE_VERSION: '18'
PNPM_VERSION: '8'
jobs:
# Job 1: PR 快速验证 - 只运行关键测试
pr-validation:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: juhi_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup test database
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
- name: Build backend
run: |
cd backend
npm run build
- name: Build frontend
run: |
cd frontend
npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Start backend server
run: |
cd backend
npm run start &
sleep 10
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
REDIS_URL: redis://localhost:6379
NODE_ENV: test
- name: Start frontend server
run: |
cd frontend
npm run preview &
sleep 5
env:
VITE_API_URL: http://localhost:3000
- name: Run critical E2E tests
run: |
cd e2e
npx playwright test \
tests/auth/login.spec.ts \
tests/navigation/full-menu-click.spec.ts \
tests/multi-tenant/data-isolation.spec.ts \
--reporter=html
env:
E2E_BASE_URL: http://localhost:5173
E2E_TEST_USER: admin@juhi.com
E2E_TEST_PASSWORD: Admin@123
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-pr
path: e2e/playwright-report/
retention-days: 7
- name: Comment PR with test results
if: always() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const reportPath = 'e2e/playwright-report/index.html';
const testsPassed = !fs.existsSync('e2e/test-results/');
const comment = testsPassed
? '✅ E2E 测试通过!'
: '❌ E2E 测试失败,请查看报告';
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
# Job 2: 完整测试套件 - Main 分支和每日定时
full-test-suite:
if: github.event_name == 'push' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_suite == 'all')
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: juhi_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup test database
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
- name: Build backend
run: |
cd backend
npm run build
- name: Build frontend
run: |
cd frontend
npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps ${{ matrix.browser }}
- name: Start backend server
run: |
cd backend
npm run start &
sleep 10
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
REDIS_URL: redis://localhost:6379
NODE_ENV: test
- name: Start frontend server
run: |
cd frontend
npm run preview &
sleep 5
env:
VITE_API_URL: http://localhost:3000
- name: Run all E2E tests
run: |
cd e2e
npx playwright test --project=${{ matrix.browser }} --reporter=html,json
env:
E2E_BASE_URL: http://localhost:5173
E2E_TEST_USER: admin@juhi.com
E2E_TEST_PASSWORD: Admin@123
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.browser }}
path: e2e/playwright-report/
retention-days: 30
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.browser }}
path: e2e/test-results/
retention-days: 30
# Job 3: 业务流程测试
business-flows:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_suite == 'business-flows'
runs-on: ubuntu-latest
timeout-minutes: 45
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: juhi_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup test database
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
- name: Build and start services
run: |
cd backend && npm run build && npm run start &
cd frontend && npm run build && npm run preview &
sleep 15
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
REDIS_URL: redis://localhost:6379
NODE_ENV: test
VITE_API_URL: http://localhost:3000
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Run business flow tests
run: |
cd e2e
npx playwright test tests/business-flows/ --reporter=html,json
env:
E2E_BASE_URL: http://localhost:5173
E2E_TEST_USER: admin@juhi.com
E2E_TEST_PASSWORD: Admin@123
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: business-flows-report
path: e2e/playwright-report/
retention-days: 30
# Job 4: 性能基准测试
performance-benchmarks:
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_suite == 'performance')
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: juhi_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup test database
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
- name: Build and start services
run: |
cd backend && npm run build && npm run start &
cd frontend && npm run build && npm run preview &
sleep 15
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
REDIS_URL: redis://localhost:6379
NODE_ENV: production
VITE_API_URL: http://localhost:3000
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Run performance tests
run: |
cd e2e
npx playwright test \
tests/flows/complete-sales-flow.spec.ts \
tests/lead-to-cash.spec.ts \
--reporter=html,json
env:
E2E_BASE_URL: http://localhost:5173
E2E_TEST_USER: admin@juhi.com
E2E_TEST_PASSWORD: Admin@123
- name: Generate performance report
run: |
cd e2e
node scripts/generate-performance-report.js
- name: Upload performance results
if: always()
uses: actions/upload-artifact@v4
with:
name: performance-report
path: |
e2e/playwright-report/
e2e/performance-results.json
retention-days: 90
- name: Comment with performance results
if: github.event_name == 'schedule'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const results = JSON.parse(fs.readFileSync('e2e/performance-results.json', 'utf8'));
const comment = `
## 📊 每日性能基准测试报告
- **页面加载时间**: ${results.pageLoadTime}ms
- **首次内容绘制 (FCP)**: ${results.fcp}ms
- **最大内容绘制 (LCP)**: ${results.lcp}ms
- **首次输入延迟 (FID)**: ${results.fid}ms
- **累积布局偏移 (CLS)**: ${results.cls}
${results.passed ? '✅ 所有性能指标达标' : '⚠️ 部分指标未达标,请关注'}
`;
// 创建 Issue 或发送通知
// ...
# Job 5: 视觉回归测试
visual-regression:
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_suite == 'visual-regression')
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: juhi_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 获取完整历史以便对比
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup test database
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
- name: Build and start services
run: |
cd backend && npm run build && npm run start &
cd frontend && npm run build && npm run preview &
sleep 15
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/juhi_test
REDIS_URL: redis://localhost:6379
NODE_ENV: test
VITE_API_URL: http://localhost:3000
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Run visual regression tests
run: |
cd e2e
npx playwright test tests/visual-regression/ --reporter=html
env:
E2E_BASE_URL: http://localhost:5173
E2E_TEST_USER: admin@juhi.com
E2E_TEST_PASSWORD: Admin@123
- name: Upload visual diff results
if: always()
uses: actions/upload-artifact@v4
with:
name: visual-regression-report
path: |
e2e/playwright-report/
e2e/test-results/
retention-days: 30
- name: Update baseline screenshots
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
cd e2e
npx playwright test tests/visual-regression/ --update-snapshots
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add tests/visual-regression/**/*.png
git commit -m "chore: update visual regression baselines" || echo "No changes"
git push
# Job 6: 测试报告汇总
test-summary:
if: always()
needs: [pr-validation, full-test-suite, business-flows, performance-benchmarks, visual-regression]
runs-on: ubuntu-latest
steps:
- name: Download all test artifacts
uses: actions/download-artifact@v4
- name: Generate summary report
run: |
echo "## 🧪 E2E 测试汇总" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -d "playwright-report-pr" ]; then
echo "### PR 快速验证" >> $GITHUB_STEP_SUMMARY
echo "✅ 关键测试通过" >> $GITHUB_STEP_SUMMARY
fi
if [ -d "business-flows-report" ]; then
echo "### 业务流程测试" >> $GITHUB_STEP_SUMMARY
echo "✅ 业务流程测试完成" >> $GITHUB_STEP_SUMMARY
fi
if [ -d "performance-report" ]; then
echo "### 性能基准测试" >> $GITHUB_STEP_SUMMARY
echo "📊 性能测试报告已生成" >> $GITHUB_STEP_SUMMARY
fi
if [ -d "visual-regression-report" ]; then
echo "### 视觉回归测试" >> $GITHUB_STEP_SUMMARY
echo "🎨 视觉对比完成" >> $GITHUB_STEP_SUMMARY
fi
...
|
1775180536
|
1775180536
|
Edit
Delete
|
|
259
|
Merge remote-tracking branch 'origin/codex/fin Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'...
|
["*/5 * * * *"]
|
6
|
5
|
health-check.yml
|
-2
|
refs/heads/main
|
9d69e1960ec649a49c0c6f307c0fc197f47ee4c4
|
push
|
{"ref":"refs/heads/main","befo {"ref":"refs/heads/main","before":"40dae5944f158653af8288a3f38b6c97e8ce9f06","after":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","compare_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/compare/40dae5944f158653af8288a3f38b6c97e8ce9f06...9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","commits":[{"id":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","message":"Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'\n\n# Conflicts:\n#\tfrontend/src/views/invoices/Detail.vue\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:29+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":[]},{"id":"0152aae7b8ff9440c5f4e7aad113420208e6c304","message":"Merge remote-tracking branch 'origin/codex/design-scalable-autopilot-os-architecture'\n\n# Conflicts:\n#\te2e/agents/playwright-agent/index.ts\n#\te2e/agents/playwright-agent/inspectors/index.ts\n#\te2e/agents/playwright-agent/reporters/backend-reporter.ts\n#\te2e/package.json\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/0152aae7b8ff9440c5f4e7aad113420208e6c304","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:05+08:00","added":[],"removed":[],"modified":[]},{"id":"e2587fae3d50e6ef7c30450199abd1bfc910a016","message":"test(finance): add finance mainline smoke and harden invoice detail formatting","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/e2587fae3d50e6ef7c30450199abd1bfc910a016","author":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-03-31T13:47:05+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":["frontend/src/views/invoices/Detail.vue"]},{"id":"803578ebec2d6f4c0d00335c1f5c61067112d923","message":"feat(e2e): add playwright agent mvp skeleton","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/803578ebec2d6f4c0d00335c1f5c61067112d923","author":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-03-19T19:55:36+08:00","added":["e2e/agents/playwright-agent/README.md","e2e/agents/playwright-agent/__tests__/playwright-agent.unit.test.ts","e2e/agents/playwright-agent/artifacts/artifact-writer.ts","e2e/agents/playwright-agent/auth/auth-provider.ts","e2e/agents/playwright-agent/auth/storage-state-auth.ts","e2e/agents/playwright-agent/constants/diagnosis.ts","e2e/agents/playwright-agent/constants/status.ts","e2e/agents/playwright-agent/constants/timeouts.ts","e2e/agents/playwright-agent/core/action-runner.ts","e2e/agents/playwright-agent/core/browser-manager.ts","e2e/agents/playwright-agent/core/execution-engine.ts","e2e/agents/playwright-agent/core/retry-engine.ts","e2e/agents/playwright-agent/core/session-factory.ts","e2e/agents/playwright-agent/index.ts","e2e/agents/playwright-agent/inspectors/base-inspector.ts","e2e/agents/playwright-agent/inspectors/booking-inspector.ts","e2e/agents/playwright-agent/inspectors/dashboard-inspector.ts","e2e/agents/playwright-agent/inspectors/index.ts","e2e/agents/playwright-agent/inspectors/payment-inspector.ts","e2e/agents/playwright-agent/observers/console-observer.ts","e2e/agents/playwright-agent/observers/network-observer.ts","e2e/agents/playwright-agent/observers/page-probe.ts","e2e/agents/playwright-agent/reporters/backend-reporter.ts","e2e/agents/playwright-agent/reporters/json-reporter.ts","e2e/agents/playwright-agent/resolvers/selector-resolver.ts","e2e/agents/playwright-agent/types/diagnosis.ts","e2e/agents/playwright-agent/types/execution-plan.ts","e2e/agents/playwright-agent/types/execution-result.ts","e2e/agents/playwright-agent/types/execution-step.ts","e2e/agents/playwright-agent/types/inspector.ts","e2e/agents/playwright-agent/types/runtime.ts"],"removed":[],"modified":["e2e/package.json"]}],"total_commits":0,"head_commit":{"id":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","message":"Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'\n\n# Conflicts:\n#\tfrontend/src/views/invoices/Detail.vue\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:29+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":[]},"repository":{"id":6,"owner":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"law@g-hi.com","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"name":"juhi-omni-knowledge-hub","full_name":"luoanwu/juhi-omni-knowledge-hub","description":"巨嗨全域智库 - B2B RevOps 全生命周期平台","empty":false,"private":false,"fork":false,"template":false,"mirror":false,"size":5204515,"language":"","languages_url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhi-omni-knowledge-hub/languages","html_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub","url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhi-omni-knowledge-hub","link":"","ssh_url":"git@gitea.g-hi.com:luoanwu/juhi-omni-knowledge-hub.git","clone_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub.git","original_url":"https://github.com/laoluojuhai/juhi-omni-knowledge-hub.git","website":"","stars_count":0,"forks_count":0,"watchers_count":1,"branch_count":4,"open_issues_count":0,"open_pr_counter":1,"release_counter":0,"default_branch":"main","archived":false,"created_at":"2026-02-23T23:57:52+08:00","updated_at":"2026-04-03T09:40:13+08:00","archived_at":"1970-01-01T08:00:00+08:00","permissions":{"admin":true,"push":true,"pull":true},"has_code":true,"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"all","has_releases":true,"has_packages":true,"has_actions":true,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":true,"allow_rebase_update":true,"allow_manual_merge":false,"autodetect_manual_merge":false,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":false,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","topics":[],"licenses":[]},"pusher":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"sender":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"}}...
|
# 生产环境健康检查工作流
name: Health Check
on:
schedule:
# 生产环境健康检查工作流
name: Health Check
on:
schedule:
# 每 5 分钟检查一次
- cron: '*/5 * * * *'
workflow_dispatch:
jobs:
health-check:
name: 生产环境健康检查
runs-on: ubuntu-latest
if: github.repository == 'your-org/juhi' # 替换为实际仓库
steps:
- name: API 健康检查
id: api-health
run: |
RESPONSE=$(curl -sf https://juhi.example.com/health || echo '{"status":"error"}')
echo "response=$RESPONSE" >> $GITHUB_OUTPUT
STATUS=$(echo $RESPONSE | jq -r '.status // "error"')
if [ "$STATUS" != "ok" ]; then
echo "API 健康检查失败"
exit 1
fi
echo "API 健康检查通过"
- name: 前端可访问性检查
run: |
HTTP_STATUS=$(curl -so /dev/null -w "%{http_code}" https://juhi.example.com/)
if [ "$HTTP_STATUS" != "200" ]; then
echo "前端返回 HTTP $HTTP_STATUS"
exit 1
fi
echo "前端可访问性检查通过"
- name: SSL 证书检查
run: |
EXPIRY_DATE=$(echo | openssl s_client -servername juhi.example.com -connect juhi.example.com:443 2>/dev/null | openssl x509 -noout -enddate | cut -d= -f2)
EXPIRY_EPOCH=$(date -d "$EXPIRY_DATE" +%s)
NOW_EPOCH=$(date +%s)
DAYS_LEFT=$(( ($EXPIRY_EPOCH - $NOW_EPOCH) / 86400 ))
echo "SSL 证书剩余 $DAYS_LEFT 天"
if [ $DAYS_LEFT -lt 7 ]; then
echo "::warning::SSL 证书将在 $DAYS_LEFT 天后过期!"
fi
if [ $DAYS_LEFT -lt 0 ]; then
echo "SSL 证书已过期"
exit 1
fi
- name: 响应时间检查
run: |
RESPONSE_TIME=$(curl -so /dev/null -w "%{time_total}" https://juhi.example.com/health)
echo "API 响应时间: ${RESPONSE_TIME}s"
# 响应时间超过 5 秒告警
if (( $(echo "$RESPONSE_TIME > 5.0" | bc -l) )); then
echo "::warning::API 响应时间过长: ${RESPONSE_TIME}s"
fi
- name: Slack 通知(失败时)
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: '🚨 生产环境健康检查失败!请立即检查。'
webhook_url: ${{ secrets.SLACK_WEBHOOK }}
fields: repo,message,commit,author,action,eventName,workflow
...
|
1775180536
|
1775180536
|
Edit
Delete
|
|
260
|
Merge remote-tracking branch 'origin/codex/fin Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'...
|
["0 2 * * 1"]
|
6
|
5
|
performance.yml
|
-2
|
refs/heads/main
|
9d69e1960ec649a49c0c6f307c0fc197f47ee4c4
|
push
|
{"ref":"refs/heads/main","befo {"ref":"refs/heads/main","before":"40dae5944f158653af8288a3f38b6c97e8ce9f06","after":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","compare_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/compare/40dae5944f158653af8288a3f38b6c97e8ce9f06...9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","commits":[{"id":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","message":"Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'\n\n# Conflicts:\n#\tfrontend/src/views/invoices/Detail.vue\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:29+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":[]},{"id":"0152aae7b8ff9440c5f4e7aad113420208e6c304","message":"Merge remote-tracking branch 'origin/codex/design-scalable-autopilot-os-architecture'\n\n# Conflicts:\n#\te2e/agents/playwright-agent/index.ts\n#\te2e/agents/playwright-agent/inspectors/index.ts\n#\te2e/agents/playwright-agent/reporters/backend-reporter.ts\n#\te2e/package.json\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/0152aae7b8ff9440c5f4e7aad113420208e6c304","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:05+08:00","added":[],"removed":[],"modified":[]},{"id":"e2587fae3d50e6ef7c30450199abd1bfc910a016","message":"test(finance): add finance mainline smoke and harden invoice detail formatting","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/e2587fae3d50e6ef7c30450199abd1bfc910a016","author":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-03-31T13:47:05+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":["frontend/src/views/invoices/Detail.vue"]},{"id":"803578ebec2d6f4c0d00335c1f5c61067112d923","message":"feat(e2e): add playwright agent mvp skeleton","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/803578ebec2d6f4c0d00335c1f5c61067112d923","author":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"158980461+laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-03-19T19:55:36+08:00","added":["e2e/agents/playwright-agent/README.md","e2e/agents/playwright-agent/__tests__/playwright-agent.unit.test.ts","e2e/agents/playwright-agent/artifacts/artifact-writer.ts","e2e/agents/playwright-agent/auth/auth-provider.ts","e2e/agents/playwright-agent/auth/storage-state-auth.ts","e2e/agents/playwright-agent/constants/diagnosis.ts","e2e/agents/playwright-agent/constants/status.ts","e2e/agents/playwright-agent/constants/timeouts.ts","e2e/agents/playwright-agent/core/action-runner.ts","e2e/agents/playwright-agent/core/browser-manager.ts","e2e/agents/playwright-agent/core/execution-engine.ts","e2e/agents/playwright-agent/core/retry-engine.ts","e2e/agents/playwright-agent/core/session-factory.ts","e2e/agents/playwright-agent/index.ts","e2e/agents/playwright-agent/inspectors/base-inspector.ts","e2e/agents/playwright-agent/inspectors/booking-inspector.ts","e2e/agents/playwright-agent/inspectors/dashboard-inspector.ts","e2e/agents/playwright-agent/inspectors/index.ts","e2e/agents/playwright-agent/inspectors/payment-inspector.ts","e2e/agents/playwright-agent/observers/console-observer.ts","e2e/agents/playwright-agent/observers/network-observer.ts","e2e/agents/playwright-agent/observers/page-probe.ts","e2e/agents/playwright-agent/reporters/backend-reporter.ts","e2e/agents/playwright-agent/reporters/json-reporter.ts","e2e/agents/playwright-agent/resolvers/selector-resolver.ts","e2e/agents/playwright-agent/types/diagnosis.ts","e2e/agents/playwright-agent/types/execution-plan.ts","e2e/agents/playwright-agent/types/execution-result.ts","e2e/agents/playwright-agent/types/execution-step.ts","e2e/agents/playwright-agent/types/inspector.ts","e2e/agents/playwright-agent/types/runtime.ts"],"removed":[],"modified":["e2e/package.json"]}],"total_commits":0,"head_commit":{"id":"9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","message":"Merge remote-tracking branch 'origin/codex/finance-smoke-sync-20260331'\n\n# Conflicts:\n#\tfrontend/src/views/invoices/Detail.vue\n","url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub/commit/9d69e1960ec649a49c0c6f307c0fc197f47ee4c4","author":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"committer":{"name":"laoluojuhai","email":"laoluojuhai@users.noreply.github.com","username":""},"verification":null,"timestamp":"2026-04-03T09:41:29+08:00","added":["e2e/tests/auth/finance-mainline-flow-smoke.spec.ts"],"removed":[],"modified":[]},"repository":{"id":6,"owner":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"law@g-hi.com","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"name":"juhi-omni-knowledge-hub","full_name":"luoanwu/juhi-omni-knowledge-hub","description":"巨嗨全域智库 - B2B RevOps 全生命周期平台","empty":false,"private":false,"fork":false,"template":false,"mirror":false,"size":5204515,"language":"","languages_url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhi-omni-knowledge-hub/languages","html_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub","url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/juhi-omni-knowledge-hub","link":"","ssh_url":"git@gitea.g-hi.com:luoanwu/juhi-omni-knowledge-hub.git","clone_url":"https://gitea.g-hi.com/luoanwu/juhi-omni-knowledge-hub.git","original_url":"https://github.com/laoluojuhai/juhi-omni-knowledge-hub.git","website":"","stars_count":0,"forks_count":0,"watchers_count":1,"branch_count":4,"open_issues_count":0,"open_pr_counter":1,"release_counter":0,"default_branch":"main","archived":false,"created_at":"2026-02-23T23:57:52+08:00","updated_at":"2026-04-03T09:40:13+08:00","archived_at":"1970-01-01T08:00:00+08:00","permissions":{"admin":true,"push":true,"pull":true},"has_code":true,"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"all","has_releases":true,"has_packages":true,"has_actions":true,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":true,"allow_rebase_update":true,"allow_manual_merge":false,"autodetect_manual_merge":false,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":false,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","topics":[],"licenses":[]},"pusher":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"sender":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"}}...
|
# 性能测试工作流
# 运行 API 性能测试、负载测试和压力测试
name: Performan # 性能测试工作流
# 运行 API 性能测试、负载测试和压力测试
name: Performance Tests
on:
# 每周一凌晨 2 点运行
schedule:
- cron: '0 2 * * 1'
# 允许手动触发
workflow_dispatch:
inputs:
test_type:
description: '测试类型'
required: true
default: 'benchmark'
type: choice
options:
- benchmark
- load
- stress
- all
duration:
description: '测试持续时间(秒)'
required: false
default: '60'
type: string
concurrency:
description: '并发数'
required: false
default: '10'
type: string
# PR 触发时只运行基准测试
pull_request:
branches: [main]
paths:
- 'backend/src/**'
- 'backend/prisma/**'
env:
NODE_VERSION: '18'
PNPM_VERSION: '8'
jobs:
# ==================== 环境准备 ====================
setup:
name: 🔧 性能测试准备
runs-on: ubuntu-latest
outputs:
test_type: ${{ steps.config.outputs.test_type }}
duration: ${{ steps.config.outputs.duration }}
concurrency: ${{ steps.config.outputs.concurrency }}
steps:
- name: 📝 配置测试参数
id: config
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "test_type=${{ github.event.inputs.test_type }}" >> $GITHUB_OUTPUT
echo "duration=${{ github.event.inputs.duration }}" >> $GITHUB_OUTPUT
echo "concurrency=${{ github.event.inputs.concurrency }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "test_type=benchmark" >> $GITHUB_OUTPUT
echo "duration=30" >> $GITHUB_OUTPUT
echo "concurrency=5" >> $GITHUB_OUTPUT
else
echo "test_type=all" >> $GITHUB_OUTPUT
echo "duration=60" >> $GITHUB_OUTPUT
echo "concurrency=10" >> $GITHUB_OUTPUT
fi
# ==================== API 基准测试 ====================
benchmark:
name: 📊 API 基准测试
runs-on: ubuntu-latest
needs: setup
if: needs.setup.outputs.test_type == 'benchmark' || needs.setup.outputs.test_type == 'all'
timeout-minutes: 30
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: juhi_perf
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: 📥 检出代码
uses: actions/checkout@v4
- name: 📦 安装 pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: 🟢 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: 📦 安装依赖
run: pnpm install --frozen-lockfile
- name: 🗄️ 初始化数据库
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_perf
- name: 🔨 构建后端
run: |
pnpm --filter shared build
pnpm --filter backend build
- name: 🚀 启动后端服务
run: |
cd backend
npm run start &
sleep 10
env:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_perf
REDIS_URL: redis://localhost:6379
JWT_SECRET: perf-test-jwt-secret
REFRESH_TOKEN_SECRET: perf-test-refresh-token
- name: ⏳ 等待服务就绪
run: |
timeout 60 bash -c 'until curl -s http://localhost:3000/health > /dev/null; do sleep 2; done'
echo "服务已就绪"
- name: 📊 运行基准测试
run: |
cd backend
npm run test -- tests/examples/performance.test.ts --reporter=json --outputFile=benchmark-results.json
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_perf
API_URL: http://localhost:3000
- name: 📝 生成基准报告
run: |
echo "## 📊 API 基准测试报告" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "测试时间: $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "backend/benchmark-results.json" ]; then
echo "### 测试结果" >> $GITHUB_STEP_SUMMARY
cat backend/benchmark-results.json | jq '.testResults[].assertionResults[] | {name: .ancestorTitles[-1] + " > " + .title, status: .status}' >> $GITHUB_STEP_SUMMARY || true
fi
- name: 📤 上传基准测试结果
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: backend/benchmark-results.json
retention-days: 30
# ==================== 负载测试 ====================
load-test:
name: 🔥 负载测试
runs-on: ubuntu-latest
needs: setup
if: needs.setup.outputs.test_type == 'load' || needs.setup.outputs.test_type == 'all'
timeout-minutes: 45
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: juhi_load
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
steps:
- name: 📥 检出代码
uses: actions/checkout@v4
- name: 📦 安装 pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: 🟢 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: 📦 安装依赖
run: pnpm install --frozen-lockfile
- name: 🔧 安装 k6
run: |
sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6
- name: 🗄️ 初始化数据库
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_load
- name: 🔨 构建后端
run: |
pnpm --filter shared build
pnpm --filter backend build
- name: 🚀 启动后端服务
run: |
cd backend
npm run start &
sleep 10
env:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_load
REDIS_URL: redis://localhost:6379
JWT_SECRET: load-test-jwt-secret
REFRESH_TOKEN_SECRET: load-test-refresh-token
- name: ⏳ 等待服务就绪
run: |
timeout 60 bash -c 'until curl -s http://localhost:3000/health > /dev/null; do sleep 2; done'
- name: 🔥 运行负载测试
run: |
mkdir -p load-test-results
# 创建 k6 负载测试脚本
cat > load-test.js << 'EOF'
import http from 'k6/http';
import { check, sleep } from 'k6';
import { Rate, Trend } from 'k6/metrics';
const errorRate = new Rate('errors');
const responseTime = new Trend('response_time');
export const options = {
stages: [
{ duration: '30s', target: 10 }, // 预热
{ duration: '1m', target: 50 }, // 逐步增加
{ duration: '2m', target: 50 }, // 稳定负载
{ duration: '30s', target: 0 }, // 降低
],
thresholds: {
http_req_duration: ['p(95)<500'], // 95% 请求小于 500ms
errors: ['rate<0.1'], // 错误率小于 10%
},
};
const BASE_URL = 'http://localhost:3000';
export default function () {
// 健康检查
let healthRes = http.get(`${BASE_URL}/health`);
check(healthRes, { 'health check ok': (r) => r.status === 200 });
// 列表接口
let listRes = http.get(`${BASE_URL}/api/leads?page=1&pageSize=20`, {
headers: {
'Authorization': 'Bearer test-token',
'Content-Type': 'application/json',
},
});
errorRate.add(listRes.status !== 200 && listRes.status !== 401);
responseTime.add(listRes.timings.duration);
sleep(0.1);
}
EOF
k6 run --out json=load-test-results/results.json load-test.js
- name: 📊 分析负载测试结果
run: |
echo "## 🔥 负载测试报告" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "load-test-results/results.json" ]; then
echo "### 关键指标" >> $GITHUB_STEP_SUMMARY
echo "| 指标 | 值 |" >> $GITHUB_STEP_SUMMARY
echo "|------|------|" >> $GITHUB_STEP_SUMMARY
# 提取关键指标
avg_duration=$(cat load-test-results/results.json | jq -s '[.[] | select(.type=="Point" and .metric=="http_req_duration") | .data.value] | add / length' 2>/dev/null || echo "N/A")
p95_duration=$(cat load-test-results/results.json | jq -s '[.[] | select(.type=="Point" and .metric=="http_req_duration") | .data.value] | sort | .[length * 0.95 | floor]' 2>/dev/null || echo "N/A")
total_requests=$(cat load-test-results/results.json | jq -s '[.[] | select(.type=="Point" and .metric=="http_reqs")] | length' 2>/dev/null || echo "N/A")
echo "| 平均响应时间 | ${avg_duration}ms |" >> $GITHUB_STEP_SUMMARY
echo "| P95 响应时间 | ${p95_duration}ms |" >> $GITHUB_STEP_SUMMARY
echo "| 总请求数 | $total_requests |" >> $GITHUB_STEP_SUMMARY
fi
- name: 📤 上传负载测试结果
uses: actions/upload-artifact@v4
with:
name: load-test-results
path: load-test-results/
retention-days: 30
# ==================== 压力测试 ====================
stress-test:
name: 💥 压力测试
runs-on: ubuntu-latest
needs: setup
if: needs.setup.outputs.test_type == 'stress' || needs.setup.outputs.test_type == 'all'
timeout-minutes: 60
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: juhi_stress
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
steps:
- name: 📥 检出代码
uses: actions/checkout@v4
- name: 📦 安装 pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: 🟢 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: 📦 安装依赖
run: pnpm install --frozen-lockfile
- name: 🔧 安装 k6
run: |
sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6
- name: 🗄️ 初始化数据库
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_stress
- name: 🔨 构建后端
run: |
pnpm --filter shared build
pnpm --filter backend build
- name: 🚀 启动后端服务
run: |
cd backend
npm run start &
sleep 10
env:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_stress
REDIS_URL: redis://localhost:6379
JWT_SECRET: stress-test-jwt-secret
REFRESH_TOKEN_SECRET: stress-test-refresh-token
- name: ⏳ 等待服务就绪
run: |
timeout 60 bash -c 'until curl -s http://localhost:3000/health > /dev/null; do sleep 2; done'
- name: 💥 运行压力测试
run: |
mkdir -p stress-test-results
# 创建 k6 压力测试脚本
cat > stress-test.js << 'EOF'
import http from 'k6/http';
import { check, sleep } from 'k6';
import { Rate, Trend, Counter } from 'k6/metrics';
const errorRate = new Rate('errors');
const responseTime = new Trend('response_time');
const requestCount = new Counter('requests');
export const options = {
stages: [
{ duration: '1m', target: 20 }, // 预热
{ duration: '2m', target: 100 }, // 逐步增加到 100 并发
{ duration: '2m', target: 200 }, // 增加到 200 并发
{ duration: '2m', target: 300 }, // 增加到 300 并发
{ duration: '1m', target: 0 }, // 降低
],
thresholds: {
http_req_duration: ['p(99)<2000'], // 99% 请求小于 2s
errors: ['rate<0.3'], // 错误率小于 30%
},
};
const BASE_URL = 'http://localhost:3000';
export default function () {
requestCount.add(1);
let res = http.get(`${BASE_URL}/health`);
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 1000ms': (r) => r.timings.duration < 1000,
});
errorRate.add(res.status !== 200);
responseTime.add(res.timings.duration);
sleep(0.05);
}
EOF
k6 run --out json=stress-test-results/results.json stress-test.js || true
- name: 📊 分析压力测试结果
run: |
echo "## 💥 压力测试报告" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 测试目标" >> $GITHUB_STEP_SUMMARY
echo "- 最大并发: 300" >> $GITHUB_STEP_SUMMARY
echo "- 持续时间: 8 分钟" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "stress-test-results/results.json" ]; then
echo "### 结果分析" >> $GITHUB_STEP_SUMMARY
max_vus=$(cat stress-test-results/results.json | jq -s 'max_by(.data.value | numbers) | .data.value // 0' 2>/dev/null || echo "N/A")
echo "- 最大达到 VUs: $max_vus" >> $GITHUB_STEP_SUMMARY
fi
- name: 📤 上传压力测试结果
uses: actions/upload-artifact@v4
with:
name: stress-test-results
path: stress-test-results/
retention-days: 30
# ==================== 数据库性能测试 ====================
db-performance:
name: 🗄️ 数据库性能测试
runs-on: ubuntu-latest
needs: setup
if: needs.setup.outputs.test_type == 'all'
timeout-minutes: 30
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: juhi_db_perf
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: 📥 检出代码
uses: actions/checkout@v4
- name: 📦 安装 pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: 🟢 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: 📦 安装依赖
run: pnpm install --frozen-lockfile
- name: 🗄️ 初始化数据库
run: |
cd backend
npx prisma migrate deploy
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_db_perf
- name: 🔨 生成测试数据
run: |
cd backend
# 生成大量测试数据用于性能测试
cat > generate-test-data.ts << 'EOF'
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
const TENANT_ID = '00000000-0000-0000-0000-000000000001';
async function main() {
console.log('生成测试数据...');
// 创建租户
await prisma.tenants.upsert({
where: { id: TENANT_ID },
create: { id: TENANT_ID, name: 'Performance Test Tenant', code: 'PERF' },
update: {},
});
// 批量创建线索(10000 条)
const leads = [];
for (let i = 0; i < 10000; i++) {
leads.push({
id: `lead-${i.toString().padStart(5, '0')}`,
tenant_id: TENANT_ID,
biz_id: `LEAD-${Date.now()}-${i}`,
company_name: `测试公司 ${i}`,
contact_name: `联系人 ${i}`,
contact_phone: `138${i.toString().padStart(8, '0')}`,
status: ['new', 'contacted', 'qualified'][i % 3],
source: ['website', 'referral', 'advertisement'][i % 3],
created_at: new Date(),
updated_at: new Date(),
});
}
await prisma.leads.createMany({
data: leads,
skipDuplicates: true,
});
console.log('已创建 10000 条线索');
}
main()
.catch(console.error)
.finally(() => prisma.$disconnect());
EOF
npx tsx generate-test-data.ts
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_db_perf
- name: 🧪 运行数据库性能测试
run: |
cd backend
cat > db-perf-test.ts << 'EOF'
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient({
log: ['query'],
});
const TENANT_ID = '00000000-0000-0000-0000-000000000001';
interface PerfResult {
name: string;
avgMs: number;
minMs: number;
maxMs: number;
iterations: number;
}
async function benchmark(name: string, fn: () => Promise<any>, iterations = 100): Promise<PerfResult> {
const times: number[] = [];
// 预热
for (let i = 0; i < 5; i++) {
await fn();
}
// 正式测试
for (let i = 0; i < iterations; i++) {
const start = performance.now();
await fn();
times.push(performance.now() - start);
}
return {
name,
avgMs: times.reduce((a, b) => a + b, 0) / times.length,
minMs: Math.min(...times),
maxMs: Math.max(...times),
iterations,
};
}
async function main() {
const results: PerfResult[] = [];
// 测试 1: 简单查询
results.push(await benchmark('简单查询 (findMany)', async () => {
await prisma.leads.findMany({
where: { tenant_id: TENANT_ID },
take: 20,
});
}));
// 测试 2: 带筛选查询
results.push(await benchmark('带筛选查询', async () => {
await prisma.leads.findMany({
where: {
tenant_id: TENANT_ID,
status: 'new',
},
take: 20,
});
}));
// 测试 3: 计数查询
results.push(await benchmark('计数查询', async () => {
await prisma.leads.count({
where: { tenant_id: TENANT_ID },
});
}));
// 测试 4: 分页查询
results.push(await benchmark('分页查询 (第50页)', async () => {
await prisma.leads.findMany({
where: { tenant_id: TENANT_ID },
skip: 1000,
take: 20,
});
}));
// 输出结果
console.log('\n📊 数据库性能测试结果\n');
console.log('| 测试项 | 平均耗时 | 最小耗时 | 最大耗时 | 迭代次数 |');
console.log('|--------|----------|----------|----------|----------|');
for (const r of results) {
console.log(`| ${r.name} | ${r.avgMs.toFixed(2)}ms | ${r.minMs.toFixed(2)}ms | ${r.maxMs.toFixed(2)}ms | ${r.iterations} |`);
}
// 写入 JSON 结果
const fs = await import('fs');
fs.writeFileSync('db-perf-results.json', JSON.stringify(results, null, 2));
}
main()
.catch(console.error)
.finally(() => prisma.$disconnect());
EOF
npx tsx db-perf-test.ts | tee db-perf-output.txt
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_db_perf
- name: 📝 生成数据库性能报告
run: |
echo "## 🗄️ 数据库性能测试报告" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "backend/db-perf-output.txt" ]; then
cat backend/db-perf-output.txt >> $GITHUB_STEP_SUMMARY
fi
- name: 📤 上传数据库性能结果
uses: actions/upload-artifact@v4
with:
name: db-performance-results
path: |
backend/db-perf-results.json
backend/db-perf-output.txt
retention-days: 30
# ==================== 内存泄漏检测 ====================
memory-leak-detection:
name: 🧠 内存泄漏检测
runs-on: ubuntu-latest
needs: setup
if: needs.setup.outputs.test_type == 'all'
timeout-minutes: 30
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: juhi_mem
ports:
- 5432:5432
redis:
image: redis:7
ports:
- 6379:6379
steps:
- name: 📥 检出代码
uses: actions/checkout@v4
- name: 📦 安装 pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: 🟢 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: 📦 安装依赖
run: pnpm install --frozen-lockfile
- name: 🗄️ 初始化数据库
run: |
cd backend
npx prisma migrate deploy
npx prisma db seed
env:
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_mem
- name: 🔨 构建后端
run: |
pnpm --filter shared build
pnpm --filter backend build
- name: 🧠 运行内存泄漏检测
run: |
cd backend
# 使用 --expose-gc 启动服务并检测内存
node --expose-gc -e "
const http = require('http');
async function measureMemory() {
if (global.gc) global.gc();
const used = process.memoryUsage();
return {
heapUsed: Math.round(used.heapUsed / 1024 / 1024),
heapTotal: Math.round(used.heapTotal / 1024 / 1024),
rss: Math.round(used.rss / 1024 / 1024),
};
}
async function main() {
console.log('🧠 内存泄漏检测开始');
const before = await measureMemory();
console.log('初始内存:', before);
// 模拟 1000 次请求
for (let i = 0; i < 1000; i++) {
// 模拟内存分配
const arr = new Array(10000).fill(Math.random());
if (i % 100 === 0) {
if (global.gc) global.gc();
console.log('进度:', i);
}
}
if (global.gc) global.gc();
await new Promise(r => setTimeout(r, 1000));
if (global.gc) global.gc();
const after = await measureMemory();
console.log('最终内存:', after);
const diff = after.heapUsed - before.heapUsed;
console.log('内存增长:', diff, 'MB');
if (diff > 50) {
console.log('⚠️ 警告: 可能存在内存泄漏');
process.exit(1);
} else {
console.log('✅ 内存使用正常');
}
}
main().catch(err => {
console.error(err);
process.exit(1);
});
" | tee memory-leak-output.txt
env:
NODE_ENV: test
DATABASE_URL: postgresql://test:test@localhost:5432/juhi_mem
REDIS_URL: redis://localhost:6379
- name: 📝 生成内存检测报告
run: |
echo "## 🧠 内存泄漏检测报告" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "backend/memory-leak-output.txt" ]; then
echo '```' >> $GITHUB_STEP_SUMMARY
cat backend/memory-leak-output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
# ==================== 性能测试汇总 ====================
performance-summary:
name: 📋 性能测试汇总
runs-on: ubuntu-latest
needs: [benchmark, load-test, stress-test, db-performance, memory-leak-detection]
if: always()
steps:
- name: 📥 下载所有结果
uses: actions/download-artifact@v4
with:
path: all-results
continue-on-error: true
- name: 📝 生成汇总报告
run: |
echo "## 📊 性能测试汇总报告" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "测试时间: $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| 测试类型 | 状态 |" >> $GITHUB_STEP_SUMMARY
echo "|----------|------|" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.benchmark.result }}" == "success" ]; then
echo "| 📊 基准测试 | ✅ 通过 |" >> $GITHUB_STEP_SUMMARY
elif [ "${{ needs.benchmark.result }}" == "skipped" ]; then
echo "| 📊 基准测试 | ⏭️ 跳过 |" >> $GITHUB_STEP_SUMMARY
else
echo "| 📊 基准测试 | ❌ 失败 |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.load-test.result }}" == "success" ]; then
echo "| 🔥 负载测试 | ✅ 通过 |" >> $GITHUB_STEP_SUMMARY
elif [ "${{ needs.load-test.result }}" == "skipped" ]; then
echo "| 🔥 负载测试 | ⏭️ 跳过 |" >> $GITHUB_STEP_SUMMARY
else
echo "| 🔥 负载测试 | ❌ 失败 |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.stress-test.result }}" == "success" ]; then
echo "| 💥 压力测试 | ✅ 通过 |" >> $GITHUB_STEP_SUMMARY
elif [ "${{ needs.stress-test.result }}" == "skipped" ]; then
echo "| 💥 压力测试 | ⏭️ 跳过 |" >> $GITHUB_STEP_SUMMARY
else
echo "| 💥 压力测试 | ❌ 失败 |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.db-performance.result }}" == "success" ]; then
echo "| 🗄️ 数据库性能 | ✅ 通过 |" >> $GITHUB_STEP_SUMMARY
elif [ "${{ needs.db-performance.result }}" == "skipped" ]; then
echo "| 🗄️ 数据库性能 | ⏭️ 跳过 |" >> $GITHUB_STEP_SUMMARY
else
echo "| 🗄️ 数据库性能 | ❌ 失败 |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.memory-leak-detection.result }}" == "success" ]; then
echo "| 🧠 内存泄漏检测 | ✅ 通过 |" >> $GITHUB_STEP_SUMMARY
elif [ "${{ needs.memory-leak-detection.result }}" == "skipped" ]; then
echo "| 🧠 内存泄漏检测 | ⏭️ 跳过 |" >> $GITHUB_STEP_SUMMARY
else
echo "| 🧠 内存泄漏检测 | ❌ 失败 |" >> $GITHUB_STEP_SUMMARY
fi
...
|
1775180536
|
1775180536
|
Edit
Delete
|
|
46
|
build: 完善Release版本构建配置
|
["0 3 * * 1"]
|
13
|
5
|
codeql-analysis.yml
|
-2
|
refs/heads/main
|
6c80c00976d1c5ac4aaa5f76d10cf1e7b4f59448
|
push
|
{"ref":"refs/heads/main","befo {"ref":"refs/heads/main","before":"0000000000000000000000000000000000000000","after":"6c80c00976d1c5ac4aaa5f76d10cf1e7b4f59448","compare_url":"https://gitea.g-hi.com/luoanwu/printer-server/compare/c254333cc45c082124d3d4fd01a4a3fc3fda7296...6c80c00976d1c5ac4aaa5f76d10cf1e7b4f59448","commits":[{"id":"6c80c00976d1c5ac4aaa5f76d10cf1e7b4f59448","message":"build: 完善Release版本构建配置\n\n变更内容:\n- 优化版本管理: 使用语义化版本号 (versionMajor.versionMinor.versionPatch)\n- 修复签名配置路径: 使用相对路径读取keystore.properties\n- 添加V1+V2签名: 兼容Android 7+设备\n- 添加getBuildNumber()函数: 基于日期生成构建号\n- 重构测试目录: 迁移至标准src/test/java结构\n\n构建优化效果:\n- Debug版本: 8.1 MB\n- Release版本: 4.1 MB (优化48%)\n- ProGuard混淆 + 资源压缩生效\n\nCo-Authored-By: Claude Opus 4.5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/printer-server/commit/6c80c00976d1c5ac4aaa5f76d10cf1e7b4f59448","author":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"committer":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-01-21T00:05:33+08:00","added":["printer-redesign/src/test/java/com/juhai/printer/application/service/PrintTaskProcessorTest.java","printer-redesign/src/test/java/com/juhai/printer/domain/service/OrderFormatterServiceTest.java","printer-redesign/src/test/java/com/juhai/printer/domain/service/PrinterSelectorTest.java","printer-redesign/src/test/java/com/juhai/printer/test/AllTestsRunner.java","printer-redesign/src/test/java/com/juhai/printer/test/BillDomainTest.java","printer-redesign/src/test/java/com/juhai/printer/test/OrderDomainTest.java","printer-redesign/src/test/java/com/juhai/printer/test/PrintApiTest.java","printer-redesign/src/test/java/com/juhai/printer/test/PrintFunctionTest.java","printer-redesign/src/test/java/com/juhai/printer/test/PrintReliabilityTest.java","printer-redesign/src/test/java/com/juhai/printer/test/TemplateEngineTest.java","printer-redesign/src/test/java/com/juhai/printer/test/WebSocketCommunicationTest.java"],"removed":["printer-redesign/test/AllTestsRunner.java","printer-redesign/test/BillDomainTest.java","printer-redesign/test/OrderDomainTest.java","printer-redesign/test/PrintApiTest.java","printer-redesign/test/PrintFunctionTest.java","printer-redesign/test/PrintReliabilityTest.java","printer-redesign/test/TemplateEngineTest.java","printer-redesign/test/WebSocketCommunicationTest.java","printer-redesign/test/com/juhai/printer/application/service/PrintTaskProcessorTest.java","printer-redesign/test/com/juhai/printer/domain/service/OrderFormatterServiceTest.java","printer-redesign/test/com/juhai/printer/domain/service/PrinterSelectorTest.java"],"modified":["printer-redesign/build.gradle"]},{"id":"b44b6415c67f54b2d1bcd688757fec2aaf1686f4","message":"fix: 修复PrintJob状态转换和数据库初始化崩溃问题\n\n1. PrinterDatabase.optimizeDatabase()\n - 将PRAGMA命令从execSQL改为query()方法\n - Room的SupportSQLiteDatabase对PRAGMA有限制\n - 添加异常处理确保数据库优化失败不影响启动\n\n2. PrinterService.onTaskFailed()\n - 添加状态检查逻辑,根据当前状态决定处理方式\n - FAILED状态:执行重试逻辑\n - PRINTING状态:先转换为FAILED再重试\n - 其他状态:直接重新调度执行\n\n3. PrintingApplicationService.executePrintJob()\n - 新增prepareJobForPrinting()确保状态正确转换\n - CREATED -\u003e QUEUED -\u003e PRINTING 状态流转\n - 新增handleJobFailure()安全处理失败\n\nCo-Authored-By: Claude Opus 4.5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/printer-server/commit/b44b6415c67f54b2d1bcd688757fec2aaf1686f4","author":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"committer":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-01-20T23:54:24+08:00","added":[],"removed":[],"modified":["printer-redesign/application/service/PrinterService.java","printer-redesign/application/service/PrintingApplicationService.java","printer-redesign/infrastructure/database/PrinterDatabase.java","printer-redesign/scripts/build-release.sh"]},{"id":"d2d0385e8b5c1b06d7e59f108c6e9f845905c841","message":"fix: 修复编译错误并成功构建APK\n\n修复内容:\n- PrintTestActivity: 重写以修复API兼容性问题\n - observeEnabled()替代getEnabledPrinters()\n - 移除PrinterApplication依赖\n - 修复Priority/PrintType方法调用\n - 修复rawContent类型(String→byte[])\n- OrderFormatterService: 补充shouldBeep()方法闭合括号\n- TemplateRenderEngine: 修复方法调用\n - getSummary()→toString()\n - setFontSize()→setSize()\n - setWidth()→setLength()\n- PrintJobDao: 添加getActiveJobs()方法\n- QueueViewModel: 修复RxJava包装和cancel()参数\n- MainViewModel: 移除totalCount()调用\n- PrinterConfigDTO: 修复fromEntity()方法兼容性\n\n构建结果:APK 7.8MB\n\nCo-Authored-By: Claude Opus 4.5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/printer-server/commit/d2d0385e8b5c1b06d7e59f108c6e9f845905c841","author":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"committer":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-01-20T23:38:29+08:00","added":[],"removed":[],"modified":["printer-redesign/application/dto/PrinterConfigDTO.java","printer-redesign/application/engine/TemplateRenderEngine.java","printer-redesign/application/engine/TemplateValidator.java","printer-redesign/domain/service/OrderFormatterService.java","printer-redesign/infrastructure/database/dao/PrintJobDao.java","printer-redesign/infrastructure/device/EscPosExecutor.java","printer-redesign/infrastructure/device/PrinterCommandExecutor.java","printer-redesign/infrastructure/device/TsplExecutor.java","printer-redesign/infrastructure/device/driver/SystemPrintDriver.java","printer-redesign/presentation/PrintTestActivity.java","printer-redesign/presentation/viewmodel/MainViewModel.java","printer-redesign/presentation/viewmodel/QueueViewModel.java"]},{"id":"f8bc615170b4f10a4c9e1ec5261191268d6b7f0a","message":"feat: 增强应用架构与测试功能\n\n- 新增 CQRS 模式支持 (command/query/dto)\n- 添加 PrintTestActivity 测试界面\n- 新增 MainViewModel 和 QueueViewModel\n- 完善 build.gradle 配置与签名设置\n- 优化 MainActivity 功能与交互\n- 增强 PrintTaskAdapter 适配逻辑\n- 添加 proguard 混淆规则和构建脚本\n- 更新 UI 资源文件\n\nCo-Authored-By: Claude Opus 4.5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/printer-server/commit/f8bc615170b4f10a4c9e1ec5261191268d6b7f0a","author":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"committer":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-01-20T23:28:57+08:00","added":["printer-redesign/application/command/ConfigurePrinterCommand.java","printer-redesign/application/command/RecoverDeadLetterCommand.java","printer-redesign/application/command/SubmitPrintJobCommand.java","printer-redesign/application/dto/PrintJobDTO.java","printer-redesign/application/dto/PrinterConfigDTO.java","printer-redesign/application/dto/QueueStatsDTO.java","printer-redesign/application/query/GetPrintJobsQuery.java","printer-redesign/application/query/GetQueueStatsQuery.java","printer-redesign/keystore.properties.template","printer-redesign/presentation/PrintTestActivity.java","printer-redesign/presentation/viewmodel/MainViewModel.java","printer-redesign/presentation/viewmodel/QueueViewModel.java","printer-redesign/proguard-rules.pro","printer-redesign/scripts/build-release.sh","printer-redesign/scripts/generate-keystore.sh","printer-redesign/src/main/res/drawable/ic_help.xml","printer-redesign/src/main/res/layout/activity_print_test.xml"],"removed":[],"modified":[".gitignore","printer-redesign/build.gradle","printer-redesign/domain/expression/ExpressionEvaluator.java","printer-redesign/migration/BillStyleAdapter.java","printer-redesign/migration/PrintTaskAdapter.java","printer-redesign/presentation/MainActivity.java","printer-redesign/src/main/AndroidManifest.xml","printer-redesign/src/main/res/values/colors.xml","printer-redesign/src/main/res/values/strings.xml"]},{"id":"4052be41183584c726cd84d2f9d9cb5c371da83b","message":"feat: 完善模板引擎系统与UI优化\n\n模板引擎增强:\n- 新增 ExpressionEvaluator 表达式求值器,支持复杂条件判断\n- 新增 FormatPipeline 格式化管道,支持货币/日期/截断等格式化\n- 新增 ContextDataEnhanced 增强上下文,支持嵌套路径和管道\n- 新增 GroupElement 分组元素,支持条件渲染和循环渲染\n- 新增 TableElementEnhanced 增强表格,支持分组/小计/合计\n- 新增 ImageElement 图片元素,支持URL/Base64/本地文件\n- 新增 TemplateValidator 模板验证器\n- 新增 TemplateRenderEngineEnhanced 增强渲染引擎\n- 完善 TemplateManager 模板管理器\n\nUI和功能优化:\n- 新增 HealthCheckActivity 健康检查详情页\n- 新增 LogViewerActivity 日志查看页面\n- 新增 QueueDetailActivity 队列详情页面\n- 优化 MainActivity 界面布局和状态显示\n- 精简 SystemPrintDriver 代码结构\n- 新增相关资源文件和菜单\n\nCo-Authored-By: Claude Opus 4.5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/printer-server/commit/4052be41183584c726cd84d2f9d9cb5c371da83b","author":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"committer":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-01-20T23:12:50+08:00","added":["printer-redesign/application/engine/TemplateRenderEngineEnhanced.java","printer-redesign/application/engine/TemplateValidator.java","printer-redesign/docs/TEMPLATE_ENHANCEMENT_GUIDE.md","printer-redesign/domain/expression/ExpressionEvaluator.java","printer-redesign/domain/service/formatter/StrategyRegistry.java","printer-redesign/domain/template/ContextDataEnhanced.java","printer-redesign/domain/template/CutElement.java","printer-redesign/domain/template/FormatPipeline.java","printer-redesign/domain/template/GroupElement.java","printer-redesign/domain/template/ImageElement.java","printer-redesign/domain/template/QRCodeElement.java","printer-redesign/domain/template/SpacerElement.java","printer-redesign/domain/template/TableElementEnhanced.java","printer-redesign/infrastructure/device/utils/BitmapToEscPosUtil.java","printer-redesign/presentation/HealthCheckActivity.java","printer-redesign/presentation/LogViewerActivity.java","printer-redesign/presentation/QueueDetailActivity.java","printer-redesign/src/main/res/drawable/bg_error_message.xml","printer-redesign/src/main/res/drawable/bg_status_chip.xml","printer-redesign/src/main/res/drawable/ic_check_circle.xml","printer-redesign/src/main/res/drawable/ic_error.xml","printer-redesign/src/main/res/drawable/ic_print_type.xml","printer-redesign/src/main/res/drawable/ic_recover.xml","printer-redesign/src/main/res/drawable/ic_warning.xml","printer-redesign/src/main/res/layout/activity_health_check.xml","printer-redesign/src/main/res/layout/activity_log_viewer.xml","printer-redesign/src/main/res/layout/activity_queue_detail.xml","printer-redesign/src/main/res/layout/item_health_component.xml","printer-redesign/src/main/res/layout/item_print_log.xml","printer-redesign/src/main/res/layout/item_queue_job.xml","printer-redesign/src/main/res/menu/menu_log_viewer.xml","printer-redesign/src/main/res/menu/menu_queue_detail.xml"],"removed":[],"modified":["ARCHITECTURE_COMPARISON.md","CLAUDE.md","printer-redesign/ARCHITECTURE.md","printer-redesign/application/engine/TemplateManager.java","printer-redesign/application/engine/TemplateRenderEngine.java","printer-redesign/build.gradle","printer-redesign/domain/template/BarcodeElement.java","printer-redesign/domain/template/BaseElement.java","printer-redesign/domain/template/ContextData.java","printer-redesign/domain/template/LineElement.java","printer-redesign/domain/template/PrintElement.java","printer-redesign/domain/template/TableElement.java","printer-redesign/domain/template/TextElement.java","printer-redesign/infrastructure/device/driver/SystemPrintDriver.java","printer-redesign/presentation/MainActivity.java","printer-redesign/src/main/AndroidManifest.xml","printer-redesign/src/main/res/layout/activity_main.xml","printer-redesign/src/main/res/values/colors.xml"]}],"total_commits":0,"head_commit":{"id":"6c80c00976d1c5ac4aaa5f76d10cf1e7b4f59448","message":"build: 完善Release版本构建配置\n\n变更内容:\n- 优化版本管理: 使用语义化版本号 (versionMajor.versionMinor.versionPatch)\n- 修复签名配置路径: 使用相对路径读取keystore.properties\n- 添加V1+V2签名: 兼容Android 7+设备\n- 添加getBuildNumber()函数: 基于日期生成构建号\n- 重构测试目录: 迁移至标准src/test/java结构\n\n构建优化效果:\n- Debug版本: 8.1 MB\n- Release版本: 4.1 MB (优化48%)\n- ProGuard混淆 + 资源压缩生效\n\nCo-Authored-By: Claude Opus 4.5 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/printer-server/commit/6c80c00976d1c5ac4aaa5f76d10cf1e7b4f59448","author":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"committer":{"name":"hi.laoluo","email":"hi.laoluo@hilaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-01-21T00:05:33+08:00","added":["printer-redesign/src/test/java/com/juhai/printer/application/service/PrintTaskProcessorTest.java","printer-redesign/src/test/java/com/juhai/printer/domain/service/OrderFormatterServiceTest.java","printer-redesign/src/test/java/com/juhai/printer/domain/service/PrinterSelectorTest.java","printer-redesign/src/test/java/com/juhai/printer/test/AllTestsRunner.java","printer-redesign/src/test/java/com/juhai/printer/test/BillDomainTest.java","printer-redesign/src/test/java/com/juhai/printer/test/OrderDomainTest.java","printer-redesign/src/test/java/com/juhai/printer/test/PrintApiTest.java","printer-redesign/src/test/java/com/juhai/printer/test/PrintFunctionTest.java","printer-redesign/src/test/java/com/juhai/printer/test/PrintReliabilityTest.java","printer-redesign/src/test/java/com/juhai/printer/test/TemplateEngineTest.java","printer-redesign/src/test/java/com/juhai/printer/test/WebSocketCommunicationTest.java"],"removed":["printer-redesign/test/AllTestsRunner.java","printer-redesign/test/BillDomainTest.java","printer-redesign/test/OrderDomainTest.java","printer-redesign/test/PrintApiTest.java","printer-redesign/test/PrintFunctionTest.java","printer-redesign/test/PrintReliabilityTest.java","printer-redesign/test/TemplateEngineTest.java","printer-redesign/test/WebSocketCommunicationTest.java","printer-redesign/test/com/juhai/printer/application/service/PrintTaskProcessorTest.java","printer-redesign/test/com/juhai/printer/domain/service/OrderFormatterServiceTest.java","printer-redesign/test/com/juhai/printer/domain/service/PrinterSelectorTest.java"],"modified":["printer-redesign/build.gradle"]},"repository":{"id":13,"owner":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"law@g-hi.com","avatar_url":"https://gitea.g-hi.com/avatars/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"name":"printer-server","full_name":"luoanwu/printer-server","description":"KTV打印服务器 - DDD架构重构","empty":false,"private":false,"fork":false,"template":false,"parent":null,"mirror":false,"size":27,"language":"","languages_url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/printer-server/languages","html_url":"https://gitea.g-hi.com/luoanwu/printer-server","url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/printer-server","link":"","ssh_url":"git@gitea.g-hi.com:luoanwu/printer-server.git","clone_url":"https://gitea.g-hi.com/luoanwu/printer-server.git","original_url":"","website":"","stars_count":0,"forks_count":0,"watchers_count":1,"open_issues_count":0,"open_pr_counter":0,"release_counter":0,"default_branch":"main","archived":false,"created_at":"2026-02-28T11:06:40+08:00","updated_at":"2026-02-28T11:06:54+08:00","archived_at":"1970-01-01T08:00:00+08:00","permissions":{"admin":true,"push":true,"pull":true},"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"all","has_releases":true,"has_packages":true,"has_actions":true,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":true,"allow_rebase_update":true,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":false,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","repo_transfer":null},"pusher":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatars/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"sender":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatars/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"}}...
|
# KTV打印服务 - CodeQL 安全分析
# 定期运行代码安全扫描
name: CodeQL # KTV打印服务 - CodeQL 安全分析
# 定期运行代码安全扫描
name: CodeQL Analysis
on:
push:
branches: [ develop, master, main ]
pull_request:
branches: [ develop, master, main ]
schedule:
# 每周一凌晨3点运行
- cron: '0 3 * * 1'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-extended,security-and-quality
- name: Grant Execute Permission
run: chmod +x ./gradlew
- name: Build
run: ./gradlew assembleDebug --stacktrace
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
...
|
1772248014
|
1772248014
|
Edit
Delete
|