diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aecc250..486a86f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,15 +74,18 @@ jobs: REPORT_FILE="testResults-$(date +%s).trx" dotnet test \ - -c Release \ - --no-build \ - --logger "trx;LogFileName=$REPORT_FILE" \ - --results-directory TestResults + -c Release \ + --no-build \ + --logger "trx;LogFileName=testResults-$(date +%s)-$RANDOM.trx" \ + --results-directory TestResults + - name: Generate CTRF report run: | - trx=$(ls -t TestResults/*.trx | head -n 1) - echo "Using TRX: $trx" - dotnet tool run DotnetCtrfJsonReporter -p "$trx" -t nunit + mkdir -p ctrf + for trx in TestResults/*.trx; do + echo "Processing $trx" + dotnet tool run DotnetCtrfJsonReporter -p "$trx" -t nunit + done # 生成并发布测试报告,无论测试成功或失败都会执行 - name: Test Report uses: dorny/test-reporter@v2