From c46cfa265e1c568e647faff452aa0c27a2a30c0c Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Thu, 29 Jan 2026 19:23:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8DCI=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E4=B8=AD=E7=9A=84.NET=20SDK=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E9=85=8D=E7=BD=AE=E5=92=8C=E6=B5=8B=E8=AF=95=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正了.NET SDK版本配置,支持多个版本并移除重复配置 - 更新了测试结果文件命名格式以避免冲突 - 修复了CTRF报告生成的路径和参数配置 - 移除了调试步骤中的条件检查逻辑 --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcd0273..ee61f1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,12 +35,13 @@ jobs: # 当前提交哈希,作为扫描的目标版本 head: ${{ github.sha }} - # 安装和配置.NET SDK版本9.0.x + # 安装和配置.NET SDK版本 - name: Setup .NET uses: actions/setup-dotnet@v5 with: + dotnet-version: 8.0.x dotnet-version: 9.0.x - + dotnet-version: 10.0.x # 配置NuGet包缓存以加速后续构建 - name: Cache NuGet packages uses: actions/cache@v5 @@ -64,9 +65,12 @@ jobs: dotnet test \ -c Release \ --no-build \ - --logger trx \ + --logger "trx;LogFileName=testResults-$(date +%s).trx" \ --results-directory TestResults - dotnet tool run DotnetCtrfJsonReporter -t "TestResults/testResults.trx" + - name: Generate CTRF report + run: | + latest=$(ls -t TestResults/*.trx | head -n 1) + dotnet tool run DotnetCtrfJsonReporter -p "$latest" -t nunit - name: Debug - Verify CTRF files if: always() run: |