-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: "Run unit tests" | ||
|
||
permissions: write-all | ||
on: | ||
push: | ||
branches: | ||
|
@@ -18,6 +18,7 @@ jobs: | |
runs-on: windows-latest | ||
continue-on-error: true | ||
name: "Build and run unit tests" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
@@ -54,25 +55,56 @@ jobs: | |
run: msbuild Microsoft.Identity.Web.sln -r -t:build -verbosity:m -property:Configuration=Release | ||
|
||
- name: Test with .NET 6.0.x | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net6.0 -p:FROM_GITHUB_ACTION=true --configuration Release --collect:"Code Coverage;Format=Cobertura" --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)" | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net6.0 -v normal -p:FROM_GITHUB_ACTION=true --configuration Release --collect "Xplat Code Coverage" --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)&(FullyQualifiedName!~TokenAcquirerTests)" | ||
|
||
- name: Create code coverage report | ||
run: | | ||
dotnet tool install -g dotnet-reportgenerator-globaltool | ||
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura' | ||
- name: Write Coverage to Job Summary | ||
shell: bash | ||
run: cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Upload Coverage Report | ||
uses: actions/upload-artifact@v4 | ||
- run: | | ||
echo "COMMENT_CONTENT_ENV_VAR<<EOF" >> $GITHUB_ENV | ||
echo $(cat CodeCoverage/SummaryGithub.md) >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Comment Coverage in PR | ||
uses: actions/github-script@v7 | ||
id: comment | ||
with: | ||
path: "$(Agent.TempDirectory)/**/coverage.cobertura.xml" | ||
|
||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: process.env.COMMENT_CONTENT_ENV_VAR | ||
}) | ||
- name: Test with .NET 7.0.x | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net7.0 -p:FROM_GITHUB_ACTION=true --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName=IntegrationTests)" | ||
|
||
- name: Test with .NET 8.0.x | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net8.0 -p:FROM_GITHUB_ACTION=true --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName=IntegrationTests)" | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net7.0 -v normal -p:FROM_GITHUB_ACTION=true --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)&(FullyQualifiedName!~TokenAcquirerTests)" | ||
|
||
- name: Test with .NET 8.0.x | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net8.0 -v normal -p:FROM_GITHUB_ACTION=true --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)&(FullyQualifiedName!~TokenAcquirerTests)" | ||
|
||
- name: Test with .NET 9.0.x | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net9.0 -v normal -p:FROM_GITHUB_ACTION=true -p:TargetNet9=True --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)&(FullyQualifiedName!~TokenAcquirerTests)" | ||
|
||
- name: Test with .NET 462 | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net462 -v normal -p:FROM_GITHUB_ACTION=true --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)" | ||
|
||
- name: Create code coverage report | ||
run: | | ||
dotnet tool install -g dotnet-reportgenerator-globaltool | ||
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura' | ||
- name: Write to Job Summary | ||
shell: bash | ||
run: cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Test with .NET 472 | ||
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f net472 -v normal -p:FROM_GITHUB_ACTION=true --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters