From 9558604273544ad45c143aed7427e1279d77192f Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 20 Apr 2021 08:09:54 -0300 Subject: [PATCH] drop Appveyor and Codecov (#2321) --- appveyor.yml | 21 ----------- build/Build.csproj | 2 - build/Context.cs | 2 - build/Lifetime.cs | 1 - build/Tasks/Clean.cs | 5 +-- build/Tasks/CodeCoverage.cs | 75 ------------------------------------- build/Tasks/Package.cs | 1 - 7 files changed, 2 insertions(+), 105 deletions(-) delete mode 100644 appveyor.yml delete mode 100644 build/Tasks/CodeCoverage.cs diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 43a442608a..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -image: Visual Studio 2019 - -environment: - IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1 - -branches: - only: - - main - -init: - - git config --global core.autocrlf input - -build_script: - - dotnet --info - - ps: .\build.ps1 -LinkSources -Verbosity Verbose - -test: off - -artifacts: -- path: 'packaging\octokit*.nupkg' - name: OctokitPackages diff --git a/build/Build.csproj b/build/Build.csproj index 878cc226e9..d30897b482 100644 --- a/build/Build.csproj +++ b/build/Build.csproj @@ -9,8 +9,6 @@ - - diff --git a/build/Context.cs b/build/Context.cs index 16c925a665..e0af2ff004 100644 --- a/build/Context.cs +++ b/build/Context.cs @@ -14,8 +14,6 @@ public class Context : FrostingContext public BuildVersion Version { get; set; } public DirectoryPath Artifacts { get; set; } - public DirectoryPath CodeCoverage { get; set; } - public bool IsLocalBuild { get; set; } public bool IsPullRequest { get; set; } public bool IsOriginalRepo { get; set; } diff --git a/build/Lifetime.cs b/build/Lifetime.cs index 4d3ff41317..a28729bb13 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -16,7 +16,6 @@ public override void Setup(Context context) context.FormatCode = context.Argument("formatCode", false); context.Artifacts = "./packaging/"; - context.CodeCoverage = "./coverage-results/"; // Build system information. var buildSystem = context.BuildSystem(); diff --git a/build/Tasks/Clean.cs b/build/Tasks/Clean.cs index f0a82f1473..4737ef3bd9 100644 --- a/build/Tasks/Clean.cs +++ b/build/Tasks/Clean.cs @@ -13,12 +13,11 @@ public override void Run(Context context) var directories = context.GetDirectories("./**/bin", globberSettings) + context.GetDirectories("./**/obj", globberSettings) - + context.Artifacts - + context.CodeCoverage; + + context.Artifacts; foreach (var directory in directories) { context.CleanDirectory(directory); } } -} \ No newline at end of file +} diff --git a/build/Tasks/CodeCoverage.cs b/build/Tasks/CodeCoverage.cs deleted file mode 100644 index a771e32dee..0000000000 --- a/build/Tasks/CodeCoverage.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Cake.Codecov; -using Cake.Common; -using Cake.Common.Build; -using Cake.Common.Diagnostics; -using Cake.Core.IO; -using Cake.Frosting; - -[Dependency(typeof(Build))] -public sealed class CodeCoverage : FrostingTask -{ - public override void Run(Context context) - { - var coverageFiles = new List(); - - if (context.AppVeyor) - { - foreach (var project in context.Projects.Where(x => x.UnitTests)) - { - context.Information("Executing Code Coverage for Project {0}...", project.Name); - - var dotNetCoreCoverage = context.CodeCoverage - .CombineWithFilePath(project.Name + "-netcoreapp3.1.xml"); - coverageFiles.Add(dotNetCoreCoverage); - - context.Coverlet(project, new CoverletToolSettings() - { - Configuration = context.Configuration, - Framework = "netcoreapp3.1", - Output = dotNetCoreCoverage.FullPath - }); - - if (context.IsRunningOnWindows()) - { - var dotNetFrameworkCoverage = context.CodeCoverage - .CombineWithFilePath(project.Name + "-net46.xml"); - coverageFiles.Add(dotNetFrameworkCoverage); - - context.Coverlet(project, new CoverletToolSettings - { - Configuration = context.Configuration, - Framework = "net46", - Output = dotNetFrameworkCoverage.FullPath - }); - } - - context.Information("Uploading Coverage Files: {0}", string.Join(",", coverageFiles.Select(path => path.GetFilename().ToString()))); - - var buildVersion = $"{context.Version.FullSemVer}.build.{context.EnvironmentVariable("APPVEYOR_BUILD_NUMBER")}"; - - var userProfilePath = context.EnvironmentVariable("USERPROFILE"); - var codecovPath = new DirectoryPath(userProfilePath) - .CombineWithFilePath(".nuget\\packages\\codecov\\1.12.4\\tools\\codecov.exe"); - - context.Tools.RegisterFile(codecovPath); - - foreach (var coverageFile in coverageFiles) - { - var settings = new CodecovSettings - { - Files = new[] { coverageFile.MakeAbsolute(context.Environment).FullPath }, - Verbose = true, - EnvironmentVariables = new Dictionary() - { - { "APPVEYOR_BUILD_VERSION", buildVersion} - } - }; - - context.Codecov(settings); - } - } - } - } -} diff --git a/build/Tasks/Package.cs b/build/Tasks/Package.cs index 6562842685..a2988a4b4d 100644 --- a/build/Tasks/Package.cs +++ b/build/Tasks/Package.cs @@ -6,7 +6,6 @@ [Dependency(typeof(UnitTests))] [Dependency(typeof(ConventionTests))] -[Dependency(typeof(CodeCoverage))] [Dependency(typeof(ValidateLINQPadSamples))] public sealed class Package : FrostingTask {