From ffeaa243d97d8206f50c128f9fc2851a8881f480 Mon Sep 17 00:00:00 2001 From: H-Chris233 Date: Fri, 8 May 2026 19:15:54 +0800 Subject: [PATCH] Keep backend test CI executable on Windows The #295 unit suite now runs in CI, but the Windows clean runner exits before the lib test harness starts with STATUS_ENTRYPOINT_NOT_FOUND when optional native runtime entrypoints are absent. Windows still needs cfg/link coverage, while macOS and Linux can execute the shared Rust unit suite. Constraint: Preserve the new Rust test gate without making optional Windows native runtime installation a CI prerequisite. Rejected: Install Foundry/Windows App Runtime into every CI run | broader, slower, and unrelated to backend unit-test coverage. Confidence: high Scope-risk: narrow Directive: Do not switch Windows back to executing the lib test binary until the optional native runtime dependency is present on the runner. Tested: cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib Not-tested: Windows CI rerun before push. --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0baf87fe..6f7453e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,8 +92,16 @@ jobs: run: cargo check --manifest-path src-tauri/Cargo.toml - name: Run Rust backend unit tests + if: runner.os != 'Windows' run: cargo test --manifest-path src-tauri/Cargo.toml --lib + - name: Compile Rust backend unit tests (Windows) + # Windows runner 能链接 lib test binary,但干净镜像缺少可选 native runtime + # DLL entrypoint 时,进程会在 test harness 启动前退出。这里保留 cfg/link + # 覆盖;共享单测在 macOS / Linux 上实际执行。 + if: runner.os == 'Windows' + run: cargo test --manifest-path src-tauri/Cargo.toml --lib --no-run + - name: Verify version sync across all 5 files # 两个平台都跑这个校验:Windows runner 自带 git-bash,跨 shell 表现一致。 # 一旦版本号 drift 立刻 fail,避免发版时再发现漏改。