Skip to content

Commit

Permalink
(build) push to coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-a committed Aug 18, 2019
1 parent dff984f commit f768151
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion build/build.cake
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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");
Expand All @@ -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
});
}
}
});

Expand Down

0 comments on commit f768151

Please sign in to comment.