From 46a5a7755d872961ea1666c57bb5c2221958c25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Foidl?= Date: Mon, 15 Nov 2021 13:14:37 +0100 Subject: [PATCH] Support for .NET 6.0 (#89) * Updates for .NET 6.0 * Updated CI * Install .NET 6.0 SDK on E2E-test leg --- .azure/pipelines/jobs/build_and_test.yml | 6 +-- .azure/pipelines/jobs/coverage.yml | 2 +- .azure/pipelines/jobs/deploy_nuget.yml | 2 +- .azure/pipelines/jobs/e2e_tests.yml | 6 +-- .../pipelines/jobs/steps/dotnet-install.yml | 16 +++++-- .github/workflows/automerge.yml | 42 ------------------- Directory.Build.props | 6 +-- ReadMe.md | 9 ++-- samples/Directory.Build.props | 4 +- samples/MsTestSample/MsTestSample.csproj | 4 +- samples/NUnitSample/NUnitSample.csproj | 7 +++- .../junit2trx/TrxTestResultXmlBuilder.cs | 2 +- source/trx2junit/trx2junit.csproj | 2 +- tests/Directory.Build.props | 13 +++++- tests/trx2junit.Tests/trx2junit.Tests.csproj | 11 +---- trx2junit.sln | 3 -- 16 files changed, 53 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/automerge.yml diff --git a/.azure/pipelines/jobs/build_and_test.yml b/.azure/pipelines/jobs/build_and_test.yml index 8a976e5..1056706 100644 --- a/.azure/pipelines/jobs/build_and_test.yml +++ b/.azure/pipelines/jobs/build_and_test.yml @@ -2,7 +2,7 @@ jobs: - job: build_test displayName: build and test pool: - vmImage: 'ubuntu-18.04' + vmImage: 'ubuntu-20.04' strategy: matrix: debug-build: @@ -10,8 +10,8 @@ jobs: release-build: BUILD_CONFIG: Release steps: - # Already installed on current hosted agents - #- template: steps/dotnet-install.yml + # ~Already installed on current hosted agents~ + - template: steps/dotnet-install.yml - bash: | echo 'installed sdks:' diff --git a/.azure/pipelines/jobs/coverage.yml b/.azure/pipelines/jobs/coverage.yml index f72bd8c..3118a2d 100644 --- a/.azure/pipelines/jobs/coverage.yml +++ b/.azure/pipelines/jobs/coverage.yml @@ -1,7 +1,7 @@ jobs: - job: coverage_report_quality pool: - vmImage: 'ubuntu-18.04' + vmImage: 'ubuntu-20.04' steps: # checkout is needed for file-references #- checkout: none diff --git a/.azure/pipelines/jobs/deploy_nuget.yml b/.azure/pipelines/jobs/deploy_nuget.yml index 98eb18a..8d2cf61 100644 --- a/.azure/pipelines/jobs/deploy_nuget.yml +++ b/.azure/pipelines/jobs/deploy_nuget.yml @@ -1,7 +1,7 @@ jobs: - job: deploy_nuget pool: - vmImage: 'ubuntu-18.04' + vmImage: 'ubuntu-20.04' steps: - checkout: none diff --git a/.azure/pipelines/jobs/e2e_tests.yml b/.azure/pipelines/jobs/e2e_tests.yml index 0c815d2..d5ec5c6 100644 --- a/.azure/pipelines/jobs/e2e_tests.yml +++ b/.azure/pipelines/jobs/e2e_tests.yml @@ -2,10 +2,10 @@ jobs: - job: e2e_tests displayName: e2e tests pool: - vmImage: 'ubuntu-18.04' + vmImage: 'ubuntu-20.04' steps: - # Already installed on current hosted agents - #- template: steps/dotnet-install.yml + # ~Already installed on current hosted agents~ + - template: steps/dotnet-install.yml - bash: | sudo apt update diff --git a/.azure/pipelines/jobs/steps/dotnet-install.yml b/.azure/pipelines/jobs/steps/dotnet-install.yml index f984d7f..02e0e3d 100644 --- a/.azure/pipelines/jobs/steps/dotnet-install.yml +++ b/.azure/pipelines/jobs/steps/dotnet-install.yml @@ -1,18 +1,28 @@ steps: - task: UseDotNet@2 - displayName: 'Use dotnet sdk 5.0' + displayName: 'Use .NET SDK 6.0' + inputs: + version: 6.x + includePreviewVersions: true + installationPath: $(Agent.ToolsDirectory)/dotnet + + - task: UseDotNet@2 + displayName: 'Use .NET SDK 5.0' inputs: version: 5.x + installationPath: $(Agent.ToolsDirectory)/dotnet includePreviewVersions: true - task: UseDotNet@2 - displayName: 'Use dotnet sdk 3.1' + displayName: 'Use .NET SDK 3.1' inputs: version: 3.1.x + installationPath: $(Agent.ToolsDirectory)/dotnet includePreviewVersions: true - task: UseDotNet@2 - displayName: 'Use dotnet sdk 2.1' + displayName: 'Use .NET SDK 2.1' inputs: version: 2.1.x + installationPath: $(Agent.ToolsDirectory)/dotnet includePreviewVersions: true diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 3774ed3..0000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Reminder: -# ========= -# branch protection rules must be set, otherwise the automerge will happen as soon as the label -# is applied and not when CI is readay. - -name: automerge -on: - pull_request: - types: - - labeled - - unlabeled - - synchronize - - opened - - edited - - ready_for_review - - reopened - - unlocked - - pull_request_review: - types: - - submitted - - check_suite: - types: - - completed - - status: {} - -jobs: - automerge: - runs-on: ubuntu-latest - steps: - - name: automerge - uses: "pascalgn/automerge-action@v0.8.0" - #with: - # args: "--trace" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - MERGE_LABELS: "automerge" - #MERGE_REMOVE_LABELS: "automerge" # https://github.com/pascalgn/automerge-action/issues/56 - MERGE_METHOD: "squash" - MERGE_DELETE_BRANCH: "true" diff --git a/Directory.Build.props b/Directory.Build.props index 13ac777..9374c29 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,9 +2,9 @@ 1 - 4 - 2 - 102 + 6 + 0 + 103 dev gfoidl Foidl Günther diff --git a/ReadMe.md b/ReadMe.md index 5a4b2c3..2ad3d74 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -77,10 +77,13 @@ E.g. in CircleCI you need to run echo 'export PATH="$PATH:/root/.dotnet/tools"' >> "$BASH_ENV" ``` -### Prequisites - -[.NET Core SDK](https://dotnet.microsoft.com/download) 2.1 onwards. +### Prequisites / Supported SDKs +In order to install this tool a [.NET SDK](https://dotnet.microsoft.com/download/dotnet) must be present. Supported SDKs are: +* .NET 6.0 +* .NET 5.0 +* .NET Core 3.1 +* .NET Core 2.1 ## Development channel diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index 489328c..a42ecb6 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -3,12 +3,12 @@ - net5.0 + net6.0 false - + diff --git a/samples/MsTestSample/MsTestSample.csproj b/samples/MsTestSample/MsTestSample.csproj index d4f93b1..d978678 100644 --- a/samples/MsTestSample/MsTestSample.csproj +++ b/samples/MsTestSample/MsTestSample.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/samples/NUnitSample/NUnitSample.csproj b/samples/NUnitSample/NUnitSample.csproj index 5bfc43a..82eef1c 100644 --- a/samples/NUnitSample/NUnitSample.csproj +++ b/samples/NUnitSample/NUnitSample.csproj @@ -5,8 +5,11 @@ - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/source/trx2junit/Internal/junit2trx/TrxTestResultXmlBuilder.cs b/source/trx2junit/Internal/junit2trx/TrxTestResultXmlBuilder.cs index 8a3daaa..9d83eb0 100644 --- a/source/trx2junit/Internal/junit2trx/TrxTestResultXmlBuilder.cs +++ b/source/trx2junit/Internal/junit2trx/TrxTestResultXmlBuilder.cs @@ -84,7 +84,7 @@ private void WriteTestDefinitions() new XElement(s_XN + "Execution", new XAttribute("id", trxTestDefinition.ExecutionId!)), new XElement(s_XN + "TestMethod", new XAttribute("className", trxTestDefinition.TestClass!), - new XAttribute("name" , trxTestDefinition.TestMethod), + new XAttribute("name" , trxTestDefinition.TestMethod!), new XAttribute("codeBase" , "not available") ) )); diff --git a/source/trx2junit/trx2junit.csproj b/source/trx2junit/trx2junit.csproj index 6c6b652..165c550 100644 --- a/source/trx2junit/trx2junit.csproj +++ b/source/trx2junit/trx2junit.csproj @@ -2,7 +2,7 @@ Exe - net5.0;netcoreapp3.1;netcoreapp2.1 + net6.0;net5.0;netcoreapp3.1;netcoreapp2.1 true enable diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 8e3388f..a3201eb 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -3,12 +3,21 @@ - net5.0;netcoreapp3.1;netcoreapp2.1 + net6.0;net5.0;netcoreapp3.1;netcoreapp2.1 false - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/tests/trx2junit.Tests/trx2junit.Tests.csproj b/tests/trx2junit.Tests/trx2junit.Tests.csproj index 7ad8bbc..8e7e7d2 100644 --- a/tests/trx2junit.Tests/trx2junit.Tests.csproj +++ b/tests/trx2junit.Tests/trx2junit.Tests.csproj @@ -9,16 +9,7 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/trx2junit.sln b/trx2junit.sln index 06d0558..9a667b7 100644 --- a/trx2junit.sln +++ b/trx2junit.sln @@ -74,9 +74,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{8819C279-C1A2-420B-A1FD-28F4097EC41C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{A21A387B-90BB-45B0-AD48-240B86DA1FE9}" - ProjectSection(SolutionItems) = preProject - .github\workflows\automerge.yml = .github\workflows\automerge.yml - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".azure", ".azure", "{5101A9AB-5CCE-4A20-AEA5-432BD2E4D9D2}" EndProject