Skip to content

Commit

Permalink
More YAML action updates for Linux and Windows .NET Core 8.0 runners
Browse files Browse the repository at this point in the history
  • Loading branch information
jrnelson90 committed Dec 7, 2023
1 parent d46ca00 commit 9b06840
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/8_0_Core_Unit_Tests_Linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,28 @@ jobs:
- name: Run Certify.Core.Tests.Unit Tests
run: |
export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify"
echo "# Test Results" > $GITHUB_STEP_SUMMARY
export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md
dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0

- name: Generate Test Results Report
run: |
echo "# Test Results" > $GITHUB_STEP_SUMMARY
cat ./TestResults-8_0-${{ runner.os }}/test-summary.md >> $GITHUB_STEP_SUMMARY
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0
if: ${{ always() }}

- name: Generated Test Coverage Report
run: |
reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage"
cat ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0
if: ${{ always() }}

- name: Upload dotnet test Artifacts
uses: actions/upload-artifact@master
with:
name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }}
path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
14 changes: 12 additions & 2 deletions .github/workflows/8_0_Core_Unit_Tests_Win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,29 @@ jobs:

- name: Run Certify.Core.Tests.Unit Tests
run: |
$env:GITHUB_WORKSPACE="D:\a\certify\certify\certify"
$env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify"
$env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md"
dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0

- name: Generate Test Results Report
run: |
echo "# Test Results\n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8
echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8
Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0
if: ${{ always() }}

- name: Generated Test Coverage Report
run: |
reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage"
Get-Content -Path ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0
if: ${{ always() }}

- name: Upload dotnet test Artifacts
uses: actions/upload-artifact@master
with:
name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }}
path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

0 comments on commit 9b06840

Please sign in to comment.