From fe9f610c93d32f22dbe961e1604e020127da0944 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Thu, 29 Jan 2026 19:59:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8DCTRF=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E7=94=9F=E6=88=90=E8=84=9A=E6=9C=AC=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E8=B7=AF=E5=BE=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为每个TRX文件指定正确的JSON输出路径 - 使用basename提取文件名并构建输出路径 - 添加目录创建确保输出目录存在 - 改进处理消息显示源和目标文件名 - 确保所有TRX文件都能正确转换为JSON格式 --- .github/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6385e8d..b149290 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,10 +87,17 @@ jobs: - name: Generate CTRF report run: | mkdir -p ctrf + for trx in TestResults/*.trx; do - echo "Processing $trx" - dotnet tool run DotnetCtrfJsonReporter -p "$trx" -t nunit + name=$(basename "$trx" .trx) + echo "Processing $trx -> ctrf/$name.json" + + dotnet tool run DotnetCtrfJsonReporter \ + -p "$trx" \ + -t nunit \ + -o "ctrf/$name.json" done + # 生成并发布测试报告,无论测试成功或失败都会执行 - name: Test Report uses: dorny/test-reporter@v2