diff --git a/.gitignore b/.gitignore index 95e3265f8..c442be3f9 100644 --- a/.gitignore +++ b/.gitignore @@ -268,3 +268,9 @@ Session.vim # Private test configuration and binaries. config.ps1 **/IISApplications + +#dotnet local tool install folder +.store/ + +#SignClient - prevent adding the signing client if locally installed +SignClient.exe \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 5c13a8cb7..7ed1b2762 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ $(MSBuildThisFileDirectory) $(ProjectDir)src/ Debug - $(Configuration) + $(Configuration) $(ProjectDir)bin/ $(ProjectDir)bin/obj/ @@ -12,7 +12,6 @@ $(BaseIntermediateOutputPath) $(BaseIntermediateOutputPath)/project.assets.json - $(SourceDir)Common/src @@ -21,27 +20,30 @@ $(ParentFolder.EndsWith(`Samples`, true, null)) $(MSBuildProjectName.EndsWith(`Tests`, true, null)) - $(BinDir)$(ConfigPathSegment)/$(MSBuildProjectName)/ $(BaseIntermediateOutputPath) $(IntermediateOutputRootPath)$(MSBuildProjectName)/ - false - + + + + $(MSBuildThisFileDirectory) + - - All + + 3.2.31 + all - + MIT true @@ -50,13 +52,10 @@ snupkg https://github.com/CoreWCF/CoreWCF - $(CoverletOutputDir)/$(MSBuildProjectName).xml - cobertura + cobertura - - diff --git a/GitVersion.yml b/GitVersion.yml deleted file mode 100644 index 65d90993b..000000000 --- a/GitVersion.yml +++ /dev/null @@ -1,8 +0,0 @@ -assembly-versioning-scheme: MajorMinorPatch -mode: ContinuousDeployment -branches: - master: - tag: alpha -ignore: - sha: [] -merge-message-formats: {} diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml new file mode 100644 index 000000000..451eaa2f6 --- /dev/null +++ b/azure-pipelines-ci.yml @@ -0,0 +1,31 @@ +trigger: + branches: + include: + - master + - release/* + paths: + include: + - src/ + exclude: + - src/Samples/ + +variables: + _solution: 'src/CoreWCF.sln' + _libraryProjects: 'src/CoreWCF.*/src/CoreWCF.*.csproj' + _testProjects: '**/*.Tests.csproj' + disable.coverage.autogenerate: 'true' + +stages: +- template: templates/BuildStage.yml + parameters: + buildProjects: $(_libraryProjects) + +- template: templates/TestStage.yml + parameters: + testProjects: $(_testProjects) + +- template: templates/PackStage.yml + parameters: + packProjects: $(_libraryProjects) + +- template: templates/PublishStage.yml \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 047a8bb00..6455e89bc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,8 @@ -trigger: +trigger: none + +pr: - master +- release/* variables: _solution: 'src/CoreWCF.sln' @@ -8,259 +11,10 @@ variables: disable.coverage.autogenerate: 'true' stages: -- stage: Build - displayName: Build - jobs: - - job: Build - strategy: - matrix: - Release: - _buildConfig: 'Release' - Debug: - _buildConfig: 'Debug' - pool: - vmImage: 'windows-latest' - steps: - - task: UseDotNet@2 - displayName: 'Use .NET Core sdk' - inputs: - packageType: sdk - version: 3.1.x - installationPath: $(Agent.ToolsDirectory)/dotnet - - # GitVersion task broken as of 2019-12-10. See https://github.com/GitTools/GitVersion/issues/1855 - # Installing the GitVersion tool and running it directly as a workaround - - task: DotNetCoreCLI@2 - displayName: 'Install gitversion' - inputs: - command: 'custom' - custom: 'tool' - arguments: 'install -g gitversion.tool --version 5.3.7' - - - task: DotNetCoreCLI@2 - displayName: 'Gitversion setup' - inputs: - command: 'custom' - custom: 'gitversion' - arguments: '/output buildserver' - - - task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: 'build' - projects: $(_libraryProjects) - arguments: '--configuration $(_buildConfig) /t:restore' +- template: templates/BuildStage.yml + parameters: + buildProjects: $(_libraryProjects) - - task: DotNetCoreCLI@2 - displayName: Build $(_buildConfig) - inputs: - command: 'build' - projects: $(_libraryProjects) - arguments: '--no-restore --configuration $(_buildConfig)' - - publish: $(System.DefaultWorkingDirectory)/bin - artifact: $(_buildConfig)Build - -- stage: Test - displayName: Run Tests - dependsOn: Build - jobs: - - job: TestRelease - strategy: - matrix: - Windows_netcore2.1: - imageName: 'windows-latest' - targetFramework: 'netcoreapp2.1' - testArgs: '' - Windows_netcore3.1: - imageName: 'windows-latest' - targetFramework: 'netcoreapp3.1' - testArgs: '' - Windows_netfx: - imageName: 'windows-latest' - targetFramework: 'net472' - testArgs: '' - Linux_netcore2.1: - imageName: 'ubuntu-latest' - targetFramework: 'netcoreapp2.1' - testArgs: '--filter Category!=WindowsOnly' - Linux_netcore3.1: - imageName: 'ubuntu-latest' - targetFramework: 'netcoreapp3.1' - testArgs: '--filter Category!=WindowsOnly' - displayName: Test Release - pool: - vmImage: $(imageName) - steps: - - task: DownloadPipelineArtifact@2 - displayName: Download build artifacts - inputs: - source: current - artifact: ReleaseBuild - path: $(System.DefaultWorkingDirectory)/bin - - task: DotNetCoreCLI@2 - displayName: Restore packages - inputs: - command: 'build' - projects: $(_testProjects) - arguments: '--configuration Release /t:restore' - - task: DotNetCoreCLI@2 - displayName: Build test projects - inputs: - command: 'build' - projects: $(_testProjects) - arguments: '--configuration Release --framework $(targetFramework)' - - task: DotNetCoreCLI@2 - displayName: Run Tests - timeoutInMinutes: 5 - inputs: - command: 'test' - projects: $(_testProjects) - publishTestResults: true - arguments: '--no-restore --no-build --configuration Release --framework $(targetFramework) $(testArgs)' - - job: TestDebug - strategy: - matrix: - Windows_netcore2.1: - imageName: 'windows-latest' - targetFramework: 'netcoreapp2.1' - testArgs: '' - Windows_netcore3.1: - imageName: 'windows-latest' - targetFramework: 'netcoreapp3.1' - testArgs: '' - Windows_netfx: - imageName: 'windows-latest' - targetFramework: 'net472' - testArgs: '' - Linux_netcore2.1: - imageName: 'ubuntu-latest' - targetFramework: 'netcoreapp2.1' - testArgs: '--filter Category!=WindowsOnly' - Linux_netcore3.1: - imageName: 'ubuntu-latest' - targetFramework: 'netcoreapp3.1' - testArgs: '--filter Category!=WindowsOnly' - displayName: Test Debug - pool: - vmImage: $(imageName) - steps: - - task: DownloadPipelineArtifact@2 - displayName: Download build artifacts - inputs: - source: current - artifact: DebugBuild - path: $(System.DefaultWorkingDirectory)/bin - - task: DotNetCoreCLI@2 - displayName: Restore packages - inputs: - command: 'build' - projects: $(_testProjects) - arguments: '--configuration Debug /t:restore' - - task: DotNetCoreCLI@2 - displayName: Build test projects - inputs: - command: 'build' - projects: $(_testProjects) - arguments: '--configuration Debug --framework $(targetFramework)' - - task: DotNetCoreCLI@2 - displayName: Run Tests - timeoutInMinutes: 5 - inputs: - command: 'test' - projects: $(_testProjects) - publishTestResults: true - arguments: '--no-restore --no-build --configuration Debug --framework $(targetFramework) $(testArgs)' - - job: CodeCoverage - displayName: Code Coverage - pool: - vmImage: 'windows-latest' - dependsOn: - - TestDebug - - TestRelease - steps: - - script: set PATH=%PATH%;%USERPROFILE%\.dotnet\tools - displayName: Add dotnet tools folder to path - - task: DotNetCoreCLI@2 - displayName: 'Install ReportGenerator' - inputs: - command: 'custom' - custom: 'tool' - arguments: 'install -g dotnet-reportgenerator-globaltool --version 4.6.1' - - task: DownloadPipelineArtifact@2 - displayName: Download build artifacts - inputs: - source: current - artifact: ReleaseBuild - path: $(System.DefaultWorkingDirectory)/bin - - task: DotNetCoreCLI@2 - displayName: Restore packages - inputs: - command: 'build' - projects: $(_testProjects) - arguments: '--configuration Release /t:restore' - - task: DotNetCoreCLI@2 - displayName: Build test projects - inputs: - command: 'build' - projects: $(_testProjects) - arguments: '--configuration Release --framework netcoreapp3.1' - - task: DotNetCoreCLI@2 - displayName: Run Tests with Coverage - timeoutInMinutes: 10 - inputs: - command: 'test' - projects: $(_testProjects) - publishTestResults: true - arguments: '--no-restore --no-build --configuration Release --framework netcoreapp3.1 /p:CollectCoverage=true /p:CoverletOutputDir=$(Build.ArtifactStagingDirectory)/Coverage' - - script: reportgenerator "-reports:$(Build.ArtifactStagingDirectory)/Coverage/*.xml" "-targetdir:$(Build.ArtifactStagingDirectory)/Coverage/Report" -reporttypes:HtmlInline_AzurePipelines;Cobertura;Badges - displayName: 'Generate Coverage Report' - - task: PublishCodeCoverageResults@1 - displayName: Publish Code Coverage report - inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: $(Build.ArtifactStagingDirectory)/Coverage/Report/Cobertura.xml - # To make the task not regenerate the report an environment variable was added to the pipeline in Azure DevOps; "disable.coverage.autogenerate: 'true'" - # see: https://github.com/danielpalme/ReportGenerator/wiki/Integration#attention - reportDirectory: $(Build.ArtifactStagingDirectory)/Coverage/Report/ -- stage: Pack - dependsOn: Test - displayName: Create Packages - condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual')) - jobs: - - job: Pack - pool: - vmImage: 'windows-latest' - steps: - - task: DownloadPipelineArtifact@2 - displayName: Download build artifacts - inputs: - source: current - artifact: ReleaseBuild - path: $(System.DefaultWorkingDirectory)/bin - - task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: 'build' - projects: $(_libraryProjects) - arguments: '--configuration Release /t:restore' - - task: DotNetCoreCLI@2 - displayName: Create packages - inputs: - command: 'pack' - configurationToPack: Release - searchPatternPack: $(_libraryProjects) - outputDir: '$(Build.ArtifactStagingDirectory)/Packages' - nobuild: true - includesymbols: true - arguments: '--no-restore' - - task: NuGetAuthenticate@0 - displayName: NuGet Authenticate - - task: NuGetCommand@2 - displayName: 'NuGet push' - inputs: - command: push - feedPublish: 'CoreWCF/CoreWCF' - verbosityPush: Detailed - packagesToPush: '$(Build.ArtifactStagingDirectory)/Packages/*.*' - allowPackageConflicts: true - publishPackageMetadata: true +- template: templates/TestStage.yml + parameters: + testProjects: $(_testProjects) \ No newline at end of file diff --git a/config/SignClient.json b/config/SignClient.json new file mode 100644 index 000000000..3276a45de --- /dev/null +++ b/config/SignClient.json @@ -0,0 +1,13 @@ +{ + "SignClient": { + "AzureAd": { + "AADInstance": "https://login.microsoftonline.com/", + "ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8", + "TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e" + }, + "Service": { + "Url": "https://codesign.dotnetfoundation.org/", + "ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001" + } + } +} \ No newline at end of file diff --git a/config/filelist.txt b/config/filelist.txt new file mode 100644 index 000000000..9696287b7 --- /dev/null +++ b/config/filelist.txt @@ -0,0 +1 @@ +**/CoreWCF.* \ No newline at end of file diff --git a/src/CoreWCF.sln b/src/CoreWCF.sln index aa5a9db52..f539416f4 100644 --- a/src/CoreWCF.sln +++ b/src/CoreWCF.sln @@ -20,15 +20,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreWCF.Primitives.Tests", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DAAE6286-93E2-4F2B-81D2-A32A9F024595}" ProjectSection(SolutionItems) = preProject + ..\azure-pipelines-ci.yml = ..\azure-pipelines-ci.yml ..\azure-pipelines.yml = ..\azure-pipelines.yml ..\Directory.Build.props = ..\Directory.Build.props ..\Directory.Build.targets = ..\Directory.Build.targets - ..\nuspec.props = ..\nuspec.props ..\GitVersion.yml = ..\GitVersion.yml + ..\nuspec.props = ..\nuspec.props ..\resources.props = ..\resources.props ..\resources.targets = ..\resources.targets EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{1026C1CC-83E8-444C-9B16-28E68C50A727}" + ProjectSection(SolutionItems) = preProject + ..\templates\BuildStage.yml = ..\templates\BuildStage.yml + ..\templates\CodeSignStage.yml = ..\templates\CodeSignStage.yml + ..\templates\PackStage.yml = ..\templates\PackStage.yml + ..\templates\PublishStage.yml = ..\templates\PublishStage.yml + ..\templates\TestStage.yml = ..\templates\TestStage.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -122,6 +132,7 @@ Global {7C01D118-BD40-4B0D-8728-6D61ED623081} = {73CF9B6D-0B40-422E-8F55-9D0C134E9E37} {5C693BE3-CD4A-40C9-8105-93681BF5B5A6} = {73CF9B6D-0B40-422E-8F55-9D0C134E9E37} {0BAAF301-23F3-49AC-B167-B8A88565F95B} = {73CF9B6D-0B40-422E-8F55-9D0C134E9E37} + {1026C1CC-83E8-444C-9B16-28E68C50A727} = {DAAE6286-93E2-4F2B-81D2-A32A9F024595} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2C86AC5B-B946-48AD-A3A5-0E1A29EDA4CF} diff --git a/templates/BuildStage.yml b/templates/BuildStage.yml new file mode 100644 index 000000000..cb5bf0cb9 --- /dev/null +++ b/templates/BuildStage.yml @@ -0,0 +1,51 @@ +parameters: +- name: buildProjects + default: '' + +stages: +- stage: Build + displayName: Build + jobs: + - job: Build + strategy: + matrix: + Release: + _buildConfig: 'Release' + Debug: + _buildConfig: 'Debug' + pool: + vmImage: 'windows-latest' + steps: + - task: UseDotNet@2 + displayName: 'Use .NET Core sdk' + inputs: + packageType: sdk + version: 3.1.x + installationPath: $(Agent.ToolsDirectory)/dotnet + + # NGBV project at https://github.com/dotnet/Nerdbank.GitVersioning + - task: DotNetCoreCLI@2 + inputs: + command: custom + custom: tool + arguments: install --tool-path . nbgv + displayName: Install NBGV tool + + - script: nbgv cloud + displayName: Set Version + + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: 'build' + projects: ${{ parameters.buildProjects}} + arguments: '--configuration $(_buildConfig) /t:restore' + + - task: DotNetCoreCLI@2 + displayName: Build $(_buildConfig) + inputs: + command: 'build' + projects: ${{ parameters.buildProjects}} + arguments: '--no-restore --configuration $(_buildConfig)' + - publish: $(System.DefaultWorkingDirectory)/bin + artifact: $(_buildConfig)Build \ No newline at end of file diff --git a/templates/CodeSignStage.yml b/templates/CodeSignStage.yml new file mode 100644 index 000000000..aaa8b2dd0 --- /dev/null +++ b/templates/CodeSignStage.yml @@ -0,0 +1,46 @@ +stages: +- stage: CodeSign + dependsOn: Pack + condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest'))) + jobs: + - deployment: CodeSign + displayName: Code Signing + pool: + vmImage: windows-latest + environment: Code Sign - Approvals + variables: + - group: Sign Client Credentials + strategy: + runOnce: + deploy: + steps: + # If you have MSCA: https://aka.ms/mscadocs + - task: ms-codeanalysis.vss-microsoft-security-code-analysis-devops.build-task-antimalware.AntiMalware@3 + displayName: AntiMalware Scan + inputs: + EnableServices: true + FileDirPath: $(Pipeline.Workspace)\BuildPackages + + - task: DotNetCoreCLI@2 + inputs: + command: custom + custom: tool + arguments: install --tool-path . SignClient + displayName: Install SignTool tool + + - pwsh: | + .\SignClient "Sign" ` + --baseDirectory "$(Pipeline.Workspace)\BuildPackages" ` + --input "**/*.nupkg" ` + --config "$(Pipeline.Workspace)\config\SignClient.json" ` + --filelist "$(Pipeline.Workspace)\config\filelist.txt" ` + --user "$(SignClientUser)" ` + --secret "$(SignClientSecret)" ` + --name "CoreWCF" ` + --description "CoreWCF" ` + --descriptionUrl "https://github.com/CoreWCF/CoreWCF" + displayName: Sign packages + + - publish: $(Pipeline.Workspace)/BuildPackages + displayName: Publish Signed Packages + artifact: SignedPackages diff --git a/templates/PackStage.yml b/templates/PackStage.yml new file mode 100644 index 000000000..9b11ea167 --- /dev/null +++ b/templates/PackStage.yml @@ -0,0 +1,42 @@ +parameters: +- name: packProjects + default: '' + +stages: +- stage: Pack + dependsOn: Test + displayName: Create Packages + condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest'))) + jobs: + - job: Pack + pool: + vmImage: 'windows-latest' + steps: + - task: DownloadPipelineArtifact@2 + displayName: Download build artifacts + inputs: + source: current + artifact: ReleaseBuild + path: $(System.DefaultWorkingDirectory)/bin + + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: 'build' + projects: ${{ parameters.packProjects}} + arguments: '--configuration Release /t:restore' + + - task: DotNetCoreCLI@2 + displayName: Create packages + inputs: + command: 'pack' + configurationToPack: Release + searchPatternPack: ${{ parameters.packProjects}} + outputDir: '$(Build.ArtifactStagingDirectory)/Packages' + nobuild: true + includesymbols: true + arguments: '--no-restore' + + - publish: $(Build.ArtifactStagingDirectory)/Packages + displayName: Publish Packages + artifact: BuildPackages diff --git a/templates/PublishStage.yml b/templates/PublishStage.yml new file mode 100644 index 000000000..d119e7899 --- /dev/null +++ b/templates/PublishStage.yml @@ -0,0 +1,27 @@ +stages: +- stage: Publish + dependsOn: CodeSign + condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest'))) + - job: PublishPackages + pool: + vmImage: 'windows-latest' + steps: + - task: DownloadPipelineArtifact@2 + displayName: Download Signed Packages + inputs: + source: current + artifact: SignedPackages + path: '$(Build.ArtifactStagingDirectory)/Packages' + + - task: NuGetAuthenticate@0 + displayName: NuGet Authenticate + + - task: NuGetCommand@2 + displayName: 'NuGet push' + inputs: + command: push + feedPublish: 'CoreWCF/CoreWCF' + verbosityPush: Detailed + packagesToPush: '$(Build.ArtifactStagingDirectory)/Packages/*.*' + allowPackageConflicts: true + publishPackageMetadata: true diff --git a/templates/TestStage.yml b/templates/TestStage.yml new file mode 100644 index 000000000..3f5cbbb33 --- /dev/null +++ b/templates/TestStage.yml @@ -0,0 +1,167 @@ +parameters: +- name: testProjects + default: '' + +stages: +- stage: Test + displayName: Run Tests + dependsOn: Build + jobs: + - job: TestRelease + strategy: + matrix: + Windows_netcore2.1: + imageName: 'windows-latest' + targetFramework: 'netcoreapp2.1' + testArgs: '' + Windows_netcore3.1: + imageName: 'windows-latest' + targetFramework: 'netcoreapp3.1' + testArgs: '' + Windows_netfx: + imageName: 'windows-latest' + targetFramework: 'net472' + testArgs: '' + Linux_netcore2.1: + imageName: 'ubuntu-latest' + targetFramework: 'netcoreapp2.1' + testArgs: '--filter Category!=WindowsOnly' + Linux_netcore3.1: + imageName: 'ubuntu-latest' + targetFramework: 'netcoreapp3.1' + testArgs: '--filter Category!=WindowsOnly' + displayName: Test Release + pool: + vmImage: $(imageName) + steps: + - task: DownloadPipelineArtifact@2 + displayName: Download build artifacts + inputs: + source: current + artifact: ReleaseBuild + path: $(System.DefaultWorkingDirectory)/bin + - task: DotNetCoreCLI@2 + displayName: Restore packages + inputs: + command: 'build' + projects: ${{ parameters.testProjects}} + arguments: '--configuration Release /t:restore' + - task: DotNetCoreCLI@2 + displayName: Build test projects + inputs: + command: 'build' + projects: ${{ parameters.testProjects}} + arguments: '--configuration Release --framework $(targetFramework)' + - task: DotNetCoreCLI@2 + displayName: Run Tests + timeoutInMinutes: 5 + inputs: + command: 'test' + projects: ${{ parameters.testProjects}} + publishTestResults: true + arguments: '--no-restore --no-build --configuration Release --framework $(targetFramework) $(testArgs)' + - job: TestDebug + strategy: + matrix: + Windows_netcore2.1: + imageName: 'windows-latest' + targetFramework: 'netcoreapp2.1' + testArgs: '' + Windows_netcore3.1: + imageName: 'windows-latest' + targetFramework: 'netcoreapp3.1' + testArgs: '' + Windows_netfx: + imageName: 'windows-latest' + targetFramework: 'net472' + testArgs: '' + Linux_netcore2.1: + imageName: 'ubuntu-latest' + targetFramework: 'netcoreapp2.1' + testArgs: '--filter Category!=WindowsOnly' + Linux_netcore3.1: + imageName: 'ubuntu-latest' + targetFramework: 'netcoreapp3.1' + testArgs: '--filter Category!=WindowsOnly' + displayName: Test Debug + pool: + vmImage: $(imageName) + steps: + - task: DownloadPipelineArtifact@2 + displayName: Download build artifacts + inputs: + source: current + artifact: DebugBuild + path: $(System.DefaultWorkingDirectory)/bin + - task: DotNetCoreCLI@2 + displayName: Restore packages + inputs: + command: 'build' + projects: ${{ parameters.testProjects}} + arguments: '--configuration Debug /t:restore' + - task: DotNetCoreCLI@2 + displayName: Build test projects + inputs: + command: 'build' + projects: ${{ parameters.testProjects}} + arguments: '--configuration Debug --framework $(targetFramework)' + - task: DotNetCoreCLI@2 + displayName: Run Tests + timeoutInMinutes: 5 + inputs: + command: 'test' + projects: ${{ parameters.testProjects}} + publishTestResults: true + arguments: '--no-restore --no-build --configuration Debug --framework $(targetFramework) $(testArgs)' + - job: CodeCoverage + displayName: Code Coverage + pool: + vmImage: 'windows-latest' + dependsOn: + - TestDebug + - TestRelease + steps: + - script: set PATH=%PATH%;%USERPROFILE%\.dotnet\tools + displayName: Add dotnet tools folder to path + - task: DotNetCoreCLI@2 + displayName: 'Install ReportGenerator' + inputs: + command: 'custom' + custom: 'tool' + arguments: 'install -g dotnet-reportgenerator-globaltool --version 4.6.1' + - task: DownloadPipelineArtifact@2 + displayName: Download build artifacts + inputs: + source: current + artifact: ReleaseBuild + path: $(System.DefaultWorkingDirectory)/bin + - task: DotNetCoreCLI@2 + displayName: Restore packages + inputs: + command: 'build' + projects: ${{ parameters.testProjects}} + arguments: '--configuration Release /t:restore' + - task: DotNetCoreCLI@2 + displayName: Build test projects + inputs: + command: 'build' + projects: ${{ parameters.testProjects}} + arguments: '--configuration Release --framework netcoreapp3.1' + - task: DotNetCoreCLI@2 + displayName: Run Tests with Coverage + timeoutInMinutes: 10 + inputs: + command: 'test' + projects: ${{ parameters.testProjects}} + publishTestResults: true + arguments: '--no-restore --no-build --configuration Release --framework netcoreapp3.1 /p:CollectCoverage=true /p:CoverletOutputDir=$(Build.ArtifactStagingDirectory)/Coverage' + - script: reportgenerator "-reports:$(Build.ArtifactStagingDirectory)/Coverage/*.xml" "-targetdir:$(Build.ArtifactStagingDirectory)/Coverage/Report" -reporttypes:HtmlInline_AzurePipelines;Cobertura;Badges + displayName: 'Generate Coverage Report' + - task: PublishCodeCoverageResults@1 + displayName: Publish Code Coverage report + inputs: + codeCoverageTool: 'Cobertura' + summaryFileLocation: $(Build.ArtifactStagingDirectory)/Coverage/Report/Cobertura.xml + # To make the task not regenerate the report an environment variable was added to the pipeline in Azure DevOps; "disable.coverage.autogenerate: 'true'" + # see: https://github.com/danielpalme/ReportGenerator/wiki/Integration#attention + reportDirectory: $(Build.ArtifactStagingDirectory)/Coverage/Report/ diff --git a/version.json b/version.json new file mode 100644 index 000000000..ba3e640d0 --- /dev/null +++ b/version.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", + "version": "0.1.0-alpha.{height}", + "versionHeightOffset": "200", + "semVer1NumericIdentifierPadding": 3, + "nugetPackageVersion": { + "semVer": 2 + }, + "publicReleaseRefSpec": [ + "^refs/heads/master$", + "^refs/heads/v\\d+(?:\\.\\d+)?$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +} \ No newline at end of file