feat(ci): 集成测试报告生成和发布功能

新增DotnetCtrfJsonReporter工具来生成JSON格式的测试报告,
并添加GitHub测试报告发布步骤,支持PR报告、摘要对比、
洞察分析、易失率、失败率和最慢测试等多维度报告展示。
This commit is contained in:
GeWuYou 2026-01-29 17:10:59 +08:00
parent f2b3c8663e
commit cfef1e1d03

View File

@ -64,6 +64,7 @@ jobs:
--no-build \
--logger trx \
--results-directory TestResults
dotnet tool run DotnetCtrfJsonReporter -t "TestResults/testResults.trx"
# 生成并发布测试报告,无论测试成功或失败都会执行
- name: Test Report
@ -73,3 +74,17 @@ jobs:
name: .NET Test Results
path: TestResults/*.trx
reporter: dotnet-trx
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: './ctrf/*.json'
github-report: true
pull-request-report: true
summary-delta-report: true
insights-report: true
flaky-rate-report: true
fail-rate-report: true
slowest-report: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always()