Skip to content

ci: 添加独立逻辑回归测试工作流 - #17

Merged
DNTOF merged 5 commits into
mainfrom
cursor/functional-logic-tests-c221
Nov 7, 2026
Merged

DNTOF merged 5 commits into
mainfrom
cursor/functional-logic-tests-c221

Conversation

@DNTOF

@DNTOF DNTOF commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

做了什么

增加 .github/workflows/functional-tests.yml,在 push、pull_request 和 workflow_dispatch 时分别运行四套独立逻辑测试:Auth、Features、Update、WebDav。

README 增加一小节,说明这些测试只做逻辑回归,不代替进服集成或完整插件兼容性验证。

为什么不用草稿里的 Windows runner

附带的 functional-tests.yml 只是未在 Actions 上跑过的起点。本仓库测试是 net8.0,直接链接纯逻辑源文件,不引用游戏程序集。在干净的 Ubuntu 24.04 / .NET SDK 8.0.427 上四套全部通过。

同时,2026-10-19 至 2026-11-19 期间 ubuntu-latest 正在从 24.04 迁到 26.04,同一标签可能落到不同镜像。工作流因此固定 ubuntu-24.04(与本地验证环境一致,且目前仍是受支持的托管 runner)。Windows 托管 runner 分钟计费更高,而且会跳过 Linux 上的 0600 权限断言;符号链接测试在 Ubuntu 上可以实际执行。

相对草稿的其他调整:

  • Action 使用当前 Node 24 版本并钉死提交 SHA(checkout v7.0.1、setup-dotnet v6.1.0、upload-artifact v7.0.2)。草稿里的 @v4 仍是 Node 20。
  • 显式安装 .NET 8.0.x,并跳过额外的 LTS 预装。不启用 NuGet 缓存,因为缓存需要 actions: write。
  • permissions: contents: read,checkout persist-credentials: false。没有 pull_request_target,没有 secrets,没有写权限。
  • fail-fast: false,没有 continue-on-error。某一套失败时其余套件仍会跑完,失败本身会使检查失败。
  • 测试步骤失败后仍上传 TRX(if: !cancelled()),保留 14 天。作业超时 15 分钟;同一工作流、同一事件、同一 ref 的新运行会取消进行中的运行。

本地结果(不是 GitHub Actions)

干净环境、无游戏程序集,命令与工作流一致(dotnet restore 后 dotnet test -c Release --no-restore,TRX logger):

套件 结果
Auth 178 passed / 0 failed / 0 skipped
Features 68 passed / 0 failed / 0 skipped
Update 49 passed / 0 failed / 0 skipped
WebDav 22 passed / 0 failed / 0 skipped

actionlint 1.7.12(含 shellcheck 0.9.0)对工作流文件无报错。actionlint 1.7.12 的内置 action 数据集尚不认识这些 Node 24 主版本,输入是对照对应 tag 的 action.yml 核对的。

GitHub Actions 的真实运行结果以本 PR 的检查为准,此处不把本地 dotnet test 当成 Actions 已通过。

范围

不编译或上传 SLDataAPI.dll,不改发布 / 签名,不改生产代码,不改测试断言,不下载专有游戏 DLL、LabAPI、Unity、签名密钥或真实 token。

Run the four net8.0 xUnit suites separately on push, pull request, and
workflow_dispatch without building or publishing SLDataAPI.dll.

Co-authored-by: DNT_OF <allowcache@gmail.com>
@DNTOF DNTOF closed this Nov 7, 2026
@DNTOF DNTOF reopened this Nov 7, 2026
DNTOF and others added 4 commits November 7, 2026 14:49
The repository Actions policy rejects actions owned outside DNTOF.
Check out with git, install the .NET 8 SDK from dotnet-install.sh, and
upload TRX through the job's own results service.

Co-authored-by: DNT_OF <allowcache@gmail.com>
Plain run steps do not receive the Actions results token. Use a local
JavaScript action, which this repository's owner-only action policy allows.

Co-authored-by: DNT_OF <allowcache@gmail.com>
CreateArtifact rejected camelCase JSON. Match the results service's
protobuf JSON, including plain strings for wrapper fields.

Co-authored-by: DNT_OF <allowcache@gmail.com>
Keep suite results in the job log and step summary. Downloadable TRX
artifacts wait until an official artifact action is allowed.

Co-authored-by: DNT_OF <allowcache@gmail.com>
@DNTOF
DNTOF merged commit bb002dd into main Nov 7, 2026
8 checks passed
@cursor
cursor Bot deleted the cursor/functional-logic-tests-c221 branch November 7, 2026 14:59
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