Files
bid-doctor/.github/workflows/ci.yml
YANG JIANKUAN 3344f09563 feat(ocr): 扫描件与图片识别——OCR 进文字层、资质库上传识别、大图浏览
计划见 docs/architecture/vision-plan.md(VS1–VS13,docs/decisions.md)。

- 验证:OCR(RapidOCR + PP-OCRv6 small,CPU)和 DeepSeek Flash 看图在国动投标文件
  和 7 张证书上初测(tech-validation §7,代码 spikes/s5-ocr/)
- OCR 服务 services/ocr(镜像、Compose 服务):整页转正(含 180°)、红章附近按红色通道重读
- 扫描页和插图识别后并入文字层 v6,句子标 source=ocr;出处标「OCR」(迁移 0013);
  依据识别文字的问题降级,规则不查扫描附件;国动端到端见 check-eval §16
- 资质库上传识别:添加资质对话框最上面传证书照片,识别后填表,只预填和 OCR 文字
  对得上的字段;识别值留痕、照片挂成附件(迁移 0014,提示词 vision.cert_fields v1)
- 资质库改为查看详情(只读键值 + 附件缩略图),附件用大图浏览控件看,不开新标签页
  (设计规范 §7.23);PDF 附件按页出预览图

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 17:50:13 +08:00

86 lines
2.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 合并的前提(架构 §8):类型检查、单元测试、租户隔离用例都通过;接口契约校验通过。
name: ci
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
server:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: bd_owner
POSTGRES_PASSWORD: dev-owner
POSTGRES_DB: bid_doctor
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U bd_owner" --health-interval 2s --health-retries 30
valkey:
image: valkey/valkey:8-alpine
ports: ["6379:6379"]
gotenberg: # 投标样例和招标样例都可能是 Word,转换要走 Gotenberg(SK2)
image: gotenberg/gotenberg:8
ports: ["3109:3000"]
env:
BD_TEST_PG: 127.0.0.1:5432
BD_TEST_VALKEY: redis://127.0.0.1:6379/1
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
version: "0.12.20"
- run: uv sync --frozen
- name: 数据库角色(直接跑部署用的脚本,两边不会漂移,SK2)
env:
PGHOST: 127.0.0.1
PGPASSWORD: dev-owner
POSTGRES_USER: bd_owner
POSTGRES_DB: bid_doctor
BD_APP_PASSWORD: dev-app
BD_OPS_PASSWORD: dev-ops
run: sh deploy/compose/postgres/init-roles.sh
- working-directory: server
run: |
../.venv/bin/ruff check src tests migrations
../.venv/bin/ruff format --check src tests migrations
../.venv/bin/ruff check ../services/ocr/src --config ../services/ocr/pyproject.toml
../.venv/bin/ruff format --check ../services/ocr/src
../.venv/bin/pyright
../.venv/bin/lint-imports
../.venv/bin/pytest -q
web:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- name: 接口类型要和 openapi.yaml 一致
run: |
pnpm gen:api
git diff --exit-code packages/api-client/src/schema.d.ts
- run: pnpm typecheck
- run: pnpm build
contract:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: OpenAPI 完整校验(api-design §8)
run: npx --yes @redocly/cli@1.34.0 lint docs/architecture/openapi.yaml --skip-rule operation-4xx-response --skip-rule no-server-example.com