Skip to content

ci: 挂 GitHub Actions —— 首份 CI(必过 job + 不阻断的 embedding job) - #2

Merged
heweidong-ecco merged 1 commit into
mainfrom
ci/github-actions
Sep 21, 2026
Merged

heweidong-ecco merged 1 commit into
mainfrom
ci/github-actions

Conversation

@heweidong-ecco

Copy link
Copy Markdown
Owner

本仓此前没有任何 CI(gh pr checks → no checks reported)。

两个 job

job 内容 是否阻断
test PG(pgvector:pg16) + Redis 服务容器 → psql -f schema.sql 建表 → pytest -m "not requires_ollama"(39 用例) ✅ 必需
test-embedding 装 Ollama + 拉 bge-m3 → pytest -m requires_ollama(13 用例) ⚠️ 不阻断(continue-on-error)

为什么 embedding 那个 job 不阻断:GitHub runner 只有 CPU,1.2 GB 模型走 CPU 很慢;且 test_day19 是性能断言(KV≤Ledger、RAG>KV),在共享 runner 上噪声大 ⇒ 天然 flaky。详见 docs/decisions决策/DEC-002-CI的embedding边界-20260921.md(含三个备选方案的对比与反悔成本)。

顺带

  • pytest.ini 注册 requires_ollama 标记;test_day18 / test_day19 各加一行 pytestmark
  • ⚠️ test_day19 原本没有 import pytest —— 不加会 collection 直接 NameError,已补
  • 本地已验证两条选择(就是 CI 会跑的那两条命令):
    • pytest -m "not requires_ollama" → 39 passed / 13 deselected
    • pytest -m requires_ollama → 13 passed / 39 deselected

两点说明

  • CI 的 PG 口令是刻意的公开值(ci_only_ephemeral):一次性容器、只活在 runner 内网,不是机密。真环境凭据一律走 .env(不入库)。
  • CI 的库是空的,所以必须先 psql -f schema.sql 建表 —— 这使 schema.sql 从"导出的副产品"变成 CI 的硬依赖。

提交前两问

① 有决策事项 ⇒ 已建 DEC-002(三选一:单 job 全跑 / 只跑不依赖的 / 两个 job + 后者不阻断 → 选定第三种)
② CHANGELOG 已写(第 2 轮)

本仓此前没有任何 CI(gh pr checks → no checks reported)。

- job test(必过):PG(pgvector:pg16) + Redis 服务容器 → psql -f schema.sql 建表
  → pytest -m "not requires_ollama"(39 用例)
- job test-embedding(continue-on-error):装 Ollama + 拉 bge-m3
  → pytest -m requires_ollama(13 用例)
- pytest.ini 注册 requires_ollama 标记;test_day18 / test_day19 各加 pytestmark
  (day19 原本没有 import pytest,一并补上,否则 collection NameError)
- 本地已验证两条选择:39 passed / 13 deselected,13 passed / 39 deselected

提交前两问
① 本次有决策事项 ⇒ 已建 DEC:docs/decisions决策/DEC-002-CI的embedding边界-20260921.md
   (「CI 怎么覆盖 embedding 用例」三选一:单 job 全跑 / 只跑不依赖的 /
    两个 job + 后者不阻断 → 选定第三种,理由与反悔成本见该文档)
② CHANGELOG 已写:CHANGELOG.md(第 2 轮)

注:CI 里的 PG 口令是刻意的公开值(一次性容器、runner 内网),真环境凭据一律走 .env。
@heweidong-ecco
heweidong-ecco merged commit cc97536 into main Sep 21, 2026
2 checks passed
@heweidong-ecco
heweidong-ecco deleted the ci/github-actions branch September 21, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant