Skip to content

updates for .NET 9 #6003

updates for .NET 9

updates for .NET 9 #6003

Workflow file for this run

name: "Run unit tests"
permissions:
contents: read
pull-requests: write
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- master
jobs:
build:
runs-on: windows-latest
continue-on-error: true
name: "Build and run unit tests"
strategy:
matrix:
dotnet-version:[ '6.0.x', '7.0.x', '8.0.x', '9.0.x' ]

Check failure on line 28 in .github/workflows/dotnetcore.yml

View workflow run for this annotation

GitHub Actions / Run unit tests

Invalid workflow file

The workflow is not valid. .github/workflows/dotnetcore.yml (Line: 28, Col: 9): Unexpected value 'dotnet-version:[ '6.0.x', '7.0.x', '8.0.x', '9.0.x' ]'
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: 'Setup MSBuild'
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Setup wasm-tools
run: dotnet workload install wasm-tools
- name: Build solution
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 -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 --collect "Xplat Code Coverage" --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 --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
echo "COMMENT_CONTENT_ENV_VAR<<EOF" >> $GITHUB_ENV
echo $(cat CodeCoverage/SummaryGithub.md) >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment Coverage in PR
uses: actions/github-script@v7
id: comment
with:
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 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: 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)"
- name: Test with .NET Standard 2.0
run: dotnet test --no-restore --no-build Microsoft.Identity.Web.sln -f netstandard2.0 -v normal -p:FROM_GITHUB_ACTION=true --configuration Release --filter "(FullyQualifiedName!~Microsoft.Identity.Web.Test.Integration)&(FullyQualifiedName!~WebAppUiTests)&(FullyQualifiedName!~IntegrationTests)"