drop Appveyor and Codecov (#2321)

This commit is contained in:
Brendan Forster
2021-04-20 08:09:54 -03:00
committed by GitHub
parent 15887d92cf
commit 9558604273
7 changed files with 2 additions and 105 deletions

View File

@@ -9,8 +9,6 @@
<ItemGroup>
<PackageReference Include="Cake.Coverlet" Version="2.5.4" />
<PackageReference Include="Cake.Frosting" Version="1.1.0" />
<PackageReference Include="Cake.Codecov" Version="1.0.1" />
<PackageReference Include="Codecov" Version="1.12.4" />
</ItemGroup>
</Project>

View File

@@ -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; }

View File

@@ -16,7 +16,6 @@ public class Lifetime : FrostingLifetime<Context>
context.FormatCode = context.Argument("formatCode", false);
context.Artifacts = "./packaging/";
context.CodeCoverage = "./coverage-results/";
// Build system information.
var buildSystem = context.BuildSystem();

View File

@@ -13,12 +13,11 @@ public sealed class Clean : FrostingTask<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);
}
}
}
}

View File

@@ -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<Context>
{
public override void Run(Context context)
{
var coverageFiles = new List<FilePath>();
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<string, string>()
{
{ "APPVEYOR_BUILD_VERSION", buildVersion}
}
};
context.Codecov(settings);
}
}
}
}
}

View File

@@ -6,7 +6,6 @@ using Cake.Frosting;
[Dependency(typeof(UnitTests))]
[Dependency(typeof(ConventionTests))]
[Dependency(typeof(CodeCoverage))]
[Dependency(typeof(ValidateLINQPadSamples))]
public sealed class Package : FrostingTask<Context>
{