diff --git a/.build/Build.cs b/.build/Build.cs index 8097b5d06..a4b6a30bb 100644 --- a/.build/Build.cs +++ b/.build/Build.cs @@ -15,7 +15,6 @@ namespace Build; [PublicAPI] [UnsetVisualStudioEnvironmentVariables] [PackageIcon("http://www.omnisharp.net/images/logo.png")] -[EnsureReadmeIsUpdated] [DotNetVerbosityMapping] [MSBuildVerbosityMapping] [NuGetVerbosityMapping] @@ -25,7 +24,6 @@ public sealed partial class Solution : NukeBuild, ICanBuildWithDotNetCore, ICanTestWithDotNetCore, ICanPackWithDotNetCore, - IHaveDataCollector, ICanClean, ICanUpdateReadme, IGenerateCodeCoverageReport, @@ -51,17 +49,17 @@ public sealed partial class Solution : NukeBuild, .DependsOn(Test) .DependsOn(Pack); - public Target Build => _ => _.Inherit(x => x.CoreBuild); + public Target Build => _ => _.Inherit(x => x.DotnetCoreBuild); - public Target Pack => _ => _.Inherit(x => x.CorePack) + public Target Pack => _ => _.Inherit(x => x.DotnetCorePack) .DependsOn(Clean); [ComputedGitVersion] public GitVersion GitVersion { get; } = null!; - public Target Clean => _ => _.Inherit(x => x.Clean); - public Target Restore => _ => _.Inherit(x => x.CoreRestore); + public Target Clean => _ => _.Inherit(x => x.CleanWellKnownTemporaryFiles); + public Target Restore => _ => _.Inherit(x => x.DotnetCoreRestore); - public Target Test => _ => _.Inherit(x => x.CoreTest); + public Target Test => _ => _.Inherit(x => x.DotnetCoreTest); public Target NpmInstall => _ => _ .Executes(() => @@ -79,6 +77,8 @@ public sealed partial class Solution : NukeBuild, .Before(Default) .Before(Clean); + public Target Docs => _ => _.Inherit(x => x.GenerateDocFx); + [Parameter("Configuration to build")] public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release; AbsolutePath ICanUpdateReadme.ReadmeFilePath => RootDirectory / "README.md"; diff --git a/.build/Solution.cs b/.build/Solution.cs index 9522d4e16..ad0f507f1 100644 --- a/.build/Solution.cs +++ b/.build/Solution.cs @@ -56,7 +56,7 @@ internal class LocalConstants NonEntryTargets = new[] { nameof(ICIEnvironment.CIEnvironment), - nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports), + nameof(ITriggerCodeCoverageReports.CollectCodeCoverage), nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura), nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges), nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport), @@ -96,7 +96,6 @@ RocketSurgeonGitHubActionsConfiguration configuration { configuration .ExcludeRepositoryConfigurationFiles() - .AddNugetPublish() .Jobs.OfType() .First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase)) .ConfigureStep(step => step.FetchDepth = 0) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6208e4f5e..ff6e41a64 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -29,6 +29,13 @@ "jb" ], "rollForward": false + }, + "dotnet-coverage": { + "version": "18.8.0", + "commands": [ + "dotnet-coverage" + ], + "rollForward": false } } } \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1ad5f9b8..051a66a92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,25 +107,25 @@ jobs: - name: 🎁 Restore id: restore run: | - dotnet nuke Restore --skip + dotnet nuke --target DotnetCoreRestore Restore - name: Update NuGet Cache if: always() && steps.restore-nuget-cache.outputs.cache-hit != 'true' uses: actions/cache/save@v6 with: key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/dotnet-tools.json') }}" path: '${{ github.workspace }}/.nuget/packages' - - name: ⚙ Build + - name: ⚙️ Build id: build run: | - dotnet nuke Build --skip - - name: 🚦 Test + dotnet .build/bin/Debug/.build.dll --target DotnetCoreBuild Build + - name: 💨 Test id: test run: | - dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip + dotnet .build/bin/Debug/.build.dll --target DotnetCoreTest Test CollectCodeCoverage GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport - name: 📦 Pack id: pack run: | - dotnet nuke Pack --skip + dotnet .build/bin/Debug/.build.dll --target DotnetCorePack Pack --skip Build - name: Npm install working-directory: vscode-testextension run: | diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index e18c1f5f0..eb9f682ac 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,55 +1,77 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", "definitions": { - "build": { - "type": "object", + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "Build", + "BuildVersion", + "Clean", + "CleanWellKnownTemporaryFiles", + "CollectCodeCoverage", + "Default", + "Docs", + "DotnetCoreBuild", + "DotnetCorePack", + "DotnetCoreRestore", + "DotnetCoreTest", + "DotnetToolRestore", + "GenerateCodeCoverageBadges", + "GenerateCodeCoverageReport", + "GenerateCodeCoverageReportCobertura", + "GenerateCodeCoverageSummary", + "GenerateDocFx", + "GenerateReadme", + "NpmInstall", + "Pack", + "Restore", + "Test", + "TestVscodeExtension" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "Artifacts": { - "type": "string", - "description": "The directory where artifacts are to be dropped" - }, - "Configuration": { - "type": "string", - "description": "Configuration to build", - "enum": [ - "Debug", - "Release" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" }, - "Coverage": { - "type": "string", - "description": "The directory where coverage artifacts are to be dropped" - }, "Help": { "type": "boolean", "description": "Shows the help text for this build assembly" }, "Host": { - "type": "string", "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", @@ -74,95 +96,61 @@ "type": "string", "description": "Root directory during build execution" }, - "Serve": { - "type": "boolean", - "description": "serve the docs" - }, "Skip": { "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "Build", - "BuildVersion", - "Clean", - "CoreBuild", - "CoreDocs", - "CorePack", - "CoreRestore", - "CoreTest", - "Default", - "DotnetToolRestore", - "Generate_Code_Coverage_Badges", - "Generate_Code_Coverage_Report", - "Generate_Code_Coverage_Report_Cobertura", - "Generate_Code_Coverage_Summary", - "GenerateCodeCoverageBadges", - "GenerateCodeCoverageReport", - "GenerateCodeCoverageReportCobertura", - "GenerateCodeCoverageSummary", - "GenerateReadme", - "NpmInstall", - "Pack", - "Restore", - "Test", - "TestVscodeTestExtension", - "Trigger_Code_Coverage_Reports", - "TriggerCodeCoverageReports" - ] + "$ref": "#/definitions/ExecutableTarget" } }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, "Target": { "type": "array", "description": "List of targets to be invoked. Default is '{default_target}'", "items": { - "type": "string", - "enum": [ - "Build", - "BuildVersion", - "Clean", - "CoreBuild", - "CoreDocs", - "CorePack", - "CoreRestore", - "CoreTest", - "Default", - "DotnetToolRestore", - "Generate_Code_Coverage_Badges", - "Generate_Code_Coverage_Report", - "Generate_Code_Coverage_Report_Cobertura", - "Generate_Code_Coverage_Summary", - "GenerateCodeCoverageBadges", - "GenerateCodeCoverageReport", - "GenerateCodeCoverageReportCobertura", - "GenerateCodeCoverageSummary", - "GenerateReadme", - "NpmInstall", - "Pack", - "Restore", - "Test", - "TestVscodeTestExtension", - "Trigger_Code_Coverage_Reports", - "TriggerCodeCoverageReports" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", + "$ref": "#/definitions/Verbosity" + } + } + } + }, + "allOf": [ + { + "properties": { + "Artifacts": { + "type": "string", + "description": "The directory where artifacts are to be dropped" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build", "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" + "Debug", + "Release" ] + }, + "Coverage": { + "type": "string", + "description": "The directory where coverage artifacts are to be dropped" + }, + "Serve": { + "type": [ + "boolean", + "null" + ], + "description": "serve the docs" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" } } + }, + { + "$ref": "#/definitions/NukeBuild" } - } + ] } diff --git a/Directory.Packages.props b/Directory.Packages.props index f084e8e5c..b413ef12a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -26,7 +26,7 @@ - + diff --git a/test/coverlet.runsettings b/test/coverlet.runsettings index 46a49a78a..95f15ed18 100644 --- a/test/coverlet.runsettings +++ b/test/coverlet.runsettings @@ -1,14 +1,116 @@ + - - - - - json,lcov,cobertura,opencover - [Bogus*]*,[Autofac*]*,[FakeItEasy*]*,[Moq*]*,[xunit*]*,[Microsoft.*]*,[XunitXml*]*,[coverlet.*]*,[System.*]*,[*]JetBrains.Annotations* - [OmniSharp.*]* - Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute - - - - - + + + + + json,lcov,cobertura,opencover + [Bogus*]*,[Autofac*]*,[FakeItEasy*]*,[Moq*]*,[xunit*]*,[Microsoft.*]*,[XunitXml*]*,[coverlet.*]*,[System.*]*,[*]JetBrains.Annotations* + [OmniSharp.*]* + Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute + + + + ^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$ + ^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$ + ^System\.Diagnostics\.DebuggerHiddenAttribute$ + ^System\.Diagnostics\.DebuggerNonUserCodeAttribute$ + ^System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute$ + + + + + ^Bogus.* + ^DryIoc.* + ^FakeItEasy.* + ^FluentAssertions.* + ^JetBrains\..* + ^Microsoft\..* + ^Moq.* + ^NSubstitute.* + ^Nuke.* + ^Serilog.* + ^System\..* + ^TUnit.* + ^Verify.* + ^XUnit.* + + + + + .*\.build\.dll + .*Client\.dll + .*Client\.Tests\.dll + .*Dap\.Client\.dll + .*Dap\.Protocol\.dll + .*Dap\.Protocol\.Proposals\.dll + .*Dap\.Server\.dll + .*Dap\.Shared\.dll + .*Dap\.Testing\.dll + .*Dap\.Tests\.dll + .*Generation\.Tests\.dll + .*JsonRpc\.dll + .*JsonRpc\.Generators\.dll + .*JsonRpc\.Testing\.dll + .*JsonRpc\.Tests\.dll + .*Lsp\.Integration\.Tests\.dll + .*Lsp\.Tests\.dll + .*Protocol\.dll + .*Protocol\.Proposals\.dll + .*SampleServer\.dll + .*Server\.dll + .*Shared\.dll + .*Testing\.dll + .*TestingUtils\.dll + + + .*Bogus\.dll + .*coverlet\.collector\.dll + .*coverlet\.msbuild\.dll + .*DryIoc\.Internal\.dll + .*FluentAssertions\.dll + .*GitVersion\.Tool\.dll + .*MediatR\.dll + .*Microsoft\.CodeAnalysis\.Analyzers\.dll + .*Microsoft\.CodeAnalysis\.CSharp\.Workspaces\.dll + .*Microsoft\.Extensions\.Configuration\.Binder\.dll + .*Microsoft\.Extensions\.Configuration\.dll + .*Microsoft\.Extensions\.DependencyInjection\.dll + .*Microsoft\.Extensions\.Logging\.Debug\.dll + .*Microsoft\.Extensions\.Logging\.dll + .*Microsoft\.Extensions\.Options\.ConfigurationExtensions\.dll + .*Microsoft\.Extensions\.Options\.dll + .*Microsoft\.NET\.Test\.Sdk\.dll + .*Microsoft\.NETFramework\.ReferenceAssemblies\.dll + .*Microsoft\.Reactive\.Testing\.dll + .*Microsoft\.SourceLink\.GitHub\.dll + .*Nerdbank\.Streams\.dll + .*NETStandard\.Library\.dll + .*Newtonsoft\.Json\.dll + .*NSubstitute\.dll + .*ReportGenerator\.dll + .*Rocket\.Surgery\.MSBuild\.CI\.dll + .*Rocket\.Surgery\.MSBuild\.SourceLink\.dll + .*Rocket\.Surgery\.Nuke\.dll + .*Serilog\.Extensions\.Logging\.dll + .*Serilog\.Sinks\.Debug\.dll + .*Serilog\.Sinks\.File\.dll + .*Serilog\.Sinks\.Observable\.dll + .*Serilog\.Sinks\.XUnit\.dll + .*Snapper\.dll + .*System\.Collections\.Immutable\.dll + .*System\.Reactive\.dll + .*System\.Threading\.Channels\.dll + .*Verify\.SourceGenerators\.dll + .*Verify\.Xunit\.dll + .*xunit\.dll + .*xunit\.runner\.visualstudio\.dll + .*Xunit\.SkippableFact\.dll + + + + + + + + \ No newline at end of file