From f768151327bd19e79f03af6d1a8f93b0b9f5a2a0 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Sun, 18 Aug 2019 23:29:07 +0200 Subject: [PATCH] (build) push to coveralls --- build/build.cake | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/build/build.cake b/build/build.cake index 29fc1ea6..fb2094fc 100644 --- a/build/build.cake +++ b/build/build.cake @@ -1,5 +1,7 @@ #tool "nuget:?package=NUnit.ConsoleRunner&version=3.10.0" #tool "nuget:?package=OpenCover&version=4.7.922" +#tool "nuget:?package=coveralls.io&version=1.4.2" +#addin "nuget:?package=Cake.Coveralls&version=0.10.0" ////////////////////////////////////////////////////////////////////// // ARGUMENTS @@ -41,6 +43,7 @@ Task("Build") ); // test & coverage + Information("Test and coverage..."); var testAssemblies = GetFiles(srcDir + File($"**/bin/{configuration}/*.Tests.dll")); var testOutput = binDir + File("TestResult.xml"); var coverOutput = binDir + File("CoverageResult.xml"); @@ -61,8 +64,22 @@ Task("Build") // on AppVeyor, publish testsettings.. if(EnvironmentVariable("APPVEYOR_JOB_ID") != null) { - Information("Running on appveyor. Publishing Test-Result."); + Information("Running on AppVeyor. Publishing Test-Result."); BuildSystem.AppVeyor.UploadTestResults(testOutput, AppVeyorTestResultsType.NUnit3); + + var repoToken = EnvironmentVariable("COVERALLS_REPO_TOKEN"); + if(repoToken == null) + { + Warning("We're running on AppVeyor but there is no COVERALLS_REPO_TOKEN"); + } + else + { + Information("Publishing Coverage-Result to coveralls.io"); + CoverallsIo(coverOutput, new CoverallsIoSettings() + { + RepoToken = repoToken + }); + } } });