Skip to content

Commit f3096ba

Browse files
committed
ci(validate): tools/ 改动不再强制全量 workspace 构建
tools/ 下是离线的描述符生成与发布辅助(tools/compat-*/、tools/gtc/、 publish_mcpp_index.sh),不参与任何包的构建。它们真正影响到某个包时, 生成出的 pkgs/*.lua 会一并变化,而 pkgs 规则已经能精确选中相关成员, 因此 tools/ 单独改动按 docs 处理、不选任何成员。 本 PR 自身即是例子:仅因删除 tools/compat-opencv/ 就把整个 workspace (含 ffmpeg 与 opencv 的冷构建)在三个平台上全量重跑了一遍。
1 parent ee1c440 commit f3096ba

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/validate.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ jobs:
256256
# Run the FULL workspace when the change can affect everything:
257257
# non-PR events (push to main, the nightly cron, dispatch), this
258258
# workflow file (it carries the mcpp version pins, so a version bump
259-
# always re-validates every package), the workspace manifest, or
260-
# shared test scripts. Docs-only changes select nothing.
259+
# always re-validates every package), a non-member edit to the
260+
# workspace manifest, or shared test scripts. Docs-only and tools/-only
261+
# changes select nothing.
261262
# Note: bash 3.2 on macOS runners — no associative arrays here.
262263
- name: Select affected workspace members
263264
shell: bash
@@ -272,7 +273,7 @@ jobs:
272273
while IFS= read -r f; do
273274
[ -n "$f" ] || continue
274275
case "$f" in
275-
.github/workflows/validate.yml|tests/*.sh|tools/*) full "$f" ;;
276+
.github/workflows/validate.yml|tests/*.sh) full "$f" ;;
276277
mcpp.toml)
277278
# Workspace manifest. Every new-package PR appends to the
278279
# members list, so that alone must NOT force a full run:
@@ -298,7 +299,14 @@ jobs:
298299
if grep -q "$lib" "$mt"; then add "$(basename "$(dirname "$mt")")"; hit=1; fi
299300
done
300301
[ "$hit" = 1 ] || echo "note: no workspace member exercises $f" ;;
301-
*.md|docs/*|.agents/*|.github/*) : ;;
302+
# tools/ holds OFFLINE descriptor-generation and publishing
303+
# helpers (tools/compat-*/, tools/gtc/, publish_mcpp_index.sh).
304+
# Nothing under it is consumed by a package build: when one of
305+
# them actually changes a package, the generated pkgs/*.lua
306+
# changes with it and the rule above selects the right members.
307+
# So a tools/ edit alone selects nothing rather than forcing a
308+
# full workspace rebuild.
309+
*.md|docs/*|.agents/*|.github/*|tools/*) : ;;
302310
*) full "unclassified change: $f" ;;
303311
esac
304312
done <<EOF

0 commit comments

Comments
 (0)