From bb1ecc43f5cc87443ab2440aae98e5366d74aa87 Mon Sep 17 00:00:00 2001 From: Samuel Steele Date: Wed, 11 Sep 2024 12:48:56 -0400 Subject: [PATCH] Test net8.0/net9.0 separately --- .github/workflows/default.yml | 87 +++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 19 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index a2e105c..5ff6e95 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -53,50 +53,99 @@ jobs: - name: Restore dependencies run: dotnet restore --locked-mode - - name: Run tests - run: foreach( $project in Get-ChildItem "ESCd.Extensions.*.Tests.csproj" -Recurse ) { dotnet test "$($project.FullName)" --no-restore --results-directory TestResults --logger "trx;logFileName=$($project.BaseName).trx" --collect:"XPlat Code Coverage" /p:WarningLevel=0 -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true } + - name: Run tests (net8.0) + run: foreach( $project in Get-ChildItem "ESCd.Extensions.*.Tests.csproj" -Recurse ) { dotnet test "$($project.FullName)" -f net8.0 --no-restore --results-directory TestResultsNet80 --logger "trx;logFileName=$($project.BaseName).trx" --collect:"XPlat Code Coverage" /p:WarningLevel=0 -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true } shell: pwsh - - name: Upload artifact 'test-results' + - name: Upload artifact 'test-results-net80' uses: actions/upload-artifact@v4 if: success() || failure() with: - name: test-results - path: TestResults + name: test-results-net80 + path: TestResultsNet80 - - name: Report test results + - name: Report test results (net8.0) uses: dorny/test-reporter@v1 if: success() || failure() with: - name: test results - path: TestResults/**/*.trx + name: test results (net8.0) + path: TestResultsNet80/**/*.trx reporter: dotnet-trx - - name: Generate coverage results - uses: danielpalme/ReportGenerator-GitHub-Action@5.3.6 + - name: Generate coverage results (net8.0) + uses: danielpalme/ReportGenerator-GitHub-Action@5 with: - reports: TestResults/**/coverage.cobertura.xml + reports: TestResultsNet80/**/coverage.cobertura.xml reporttypes: "Cobertura;MarkdownSummary" - targetdir: CoverageResults - title: coverage results + targetdir: CoverageResultsNet80 + title: coverage results (net8.0) - - name: Upload artifact 'coverage-results' + - name: Upload artifact 'coverage-results-net80' uses: actions/upload-artifact@v4 if: success() || failure() with: - name: coverage-results - path: CoverageResults + name: coverage-results-net80 + path: CoverageResultsNet80 - - name: Report coverage results + - name: Report coverage results (net8.0) uses: cryptoc1/cobertura-action@master if: success() || failure() with: fail_below_threshold: false link_missing_lines: true minimum_coverage: 80 - path: CoverageResults/Cobertura.xml + path: CoverageResultsNet80/Cobertura.xml repo_token: ${{ secrets.GITHUB_TOKEN }} - report_name: coverage results + report_name: coverage results (net8.0) + show_branch: false + show_class_names: true + show_missing: true + skip_covered: false + + - name: Run tests (net9.0) + run: foreach( $project in Get-ChildItem "ESCd.Extensions.*.Tests.csproj" -Recurse ) { dotnet test "$($project.FullName)" -f net9.0 --no-restore --results-directory TestResultsNet90 --logger "trx;logFileName=$($project.BaseName).trx" --collect:"XPlat Code Coverage" /p:WarningLevel=0 -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true } + shell: pwsh + + - name: Upload artifact 'test-results-net90' + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: test-results-net90 + path: TestResultsNet90 + + - name: Report test results (net9.0) + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: test results (net9.0) + path: TestResultsNet90/**/*.trx + reporter: dotnet-trx + + - name: Generate coverage results (net9.0) + uses: danielpalme/ReportGenerator-GitHub-Action@5 + with: + reports: TestResultsNet90/**/coverage.cobertura.xml + reporttypes: "Cobertura;MarkdownSummary" + targetdir: CoverageResultsNet90 + title: coverage results (net9.0) + + - name: Upload artifact 'coverage-results-net90' + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: coverage-results-net90 + path: CoverageResultsNet90 + + - name: Report coverage results (net9.0) + uses: cryptoc1/cobertura-action@master + if: success() || failure() + with: + fail_below_threshold: false + link_missing_lines: true + minimum_coverage: 80 + path: CoverageResultsNet90/Cobertura.xml + repo_token: ${{ secrets.GITHUB_TOKEN }} + report_name: coverage results (net9.0) show_branch: false show_class_names: true show_missing: true