Skip to content

Commit 1119ee7

Browse files
committed
fix(ci): 修复 Pester Test 在三平台的全部失败
修复最近 3 次 Pester Test 运行(windows-latest 12 项 Pester 失败、 ubuntu-latest 1 项 Vitest 失败)的 4 类根因,并清理 qa 因 tsgo 缺失而失败的问题。 根因 A(行尾符/哈希不一致,2 项): .gitattributes 只为 *.ps1 强制 eol=lf,Windows runner 的 core.autocrlf=true 会把 .psm1/.psd1/.env/.wslconfig 检出成 CRLF,破坏 bootstrap manifest 哈希 校验与 .wslconfig 内容比对。改为 * text=auto eol=lf 对所有文本强制 LF。 根因 B(09/WSL 管理员守卫未受 WhatIf 门控,2 项): windows/09deployAutoHotkey.ps1 与 windows/wsl/Initialize-WslHost.ps1 的 管理员守卫是无条件的,GitHub windows-latest 以管理员运行导致 -WhatIt 仍 exit 10。 按规范「WhatIf/fixture 可生成计划」,加 -not $WhatIfPreference 门控。 根因 C(managed-env adapter 在原生 Windows throw,8 项): brew/npm 走 ManagedEnvAdapter,其在原生 Windows throw。该 adapter 写 .zshrc、 设 UnixFileMode、依赖 zsh,本质只能跑在非 Windows。给 tests/PackageSources.Tests.ps1 的 8 个相关 It 加 -Skip:$IsWindows(macOS 仍全跑全过)。 根因 D(homebrew.sh 命中 CI 预装 Linuxbrew,1 项): shell/shared.d/homebrew.sh 候选顺序把系统级 /home/linuxbrew/.linuxbrew 排前, ubuntu-latest 预装真 Linuxbrew 会抢先于测试 fixture。新增 POWERSHELL_SCRIPTS_HOMEBREW_PREFIX 覆盖(显式 prefix 时跳过路径探测), 测试传入该变量隔离 fixture。 附加:移除已废弃的 @typescript/native-preview(tsgo),两个子 package 的 typecheck:fast 改用 tsc,并同步依赖升级与 pnpm-lock.yaml。 验证:pnpm test:pwsh:all(host 760/0、linux docker 756/0)、pnpm qa(176/0)、 Vitest linux-install-pipeline(12/12,typecheck 无错误)。
1 parent 3b538dd commit 1119ee7

10 files changed

Lines changed: 1071 additions & 858 deletions

File tree

‎.gitattributes‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 默认对所有文本文件强制 LF 行尾,避免 Windows runner 的 core.autocrlf=true
2+
# 把 .psm1/.psd1/.env/.wslconfig 等检出成 CRLF,从而破坏哈希校验与内容比对。
3+
# git 仍会自动识别二进制(png/ico/zip/exe 等),不会被当作文本转换。
4+
* text=auto eol=lf
5+
6+
# 显式声明仓库自有文本文件(顺带覆盖上面的通用规则,便于人类阅读)
17
.gitattributes text eol=lf
2-
*.ps1 text eol=lf
8+
*.ps1 text eol=lf
9+
*.psm1 text eol=lf
10+
*.psd1 text eol=lf
311
config/service/oss/rclone/rclone-ops.mjs text eol=lf

‎package.json‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,16 @@
6969
"author": "",
7070
"license": "ISC",
7171
"devDependencies": {
72-
"@biomejs/biome": "^2.4.16",
73-
"@types/node": "^25.9.2",
74-
"@typescript/native-preview": "7.0.0-dev.20260606.1",
72+
"@biomejs/biome": "^2.5.3",
73+
"@types/node": "^26.1.1",
7574
"concurrently": "^10.0.3",
7675
"execa": "^9.6.1",
7776
"husky": "^9.1.7",
78-
"lint-staged": "^17.0.7",
79-
"rumdl": "^0.2.8",
80-
"turbo": "^2.9.16",
81-
"typescript": "^6.0.3",
82-
"vitest": "^4.1.8"
77+
"lint-staged": "^17.0.8",
78+
"rumdl": "^0.2.30",
79+
"turbo": "^2.10.4",
80+
"typescript": "^7.0.2",
81+
"vitest": "^4.1.10"
8382
},
8483
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
8584
}

0 commit comments

Comments
 (0)