Skip to content

Commit

Permalink
push code coverage for main and develop branches
Browse files Browse the repository at this point in the history
  • Loading branch information
TomPallister committed Apr 22, 2023
1 parent fdc761c commit bc25f4e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Task("RunUnitTests")

GenerateReport(coverageSummaryFile);

if (IsRunningOnCircleCI() && IsMain())
if (IsRunningOnCircleCI() && IsMainOrDevelop())
{
var repoToken = EnvironmentVariable(coverallsRepoToken);
if (string.IsNullOrEmpty(repoToken))
Expand Down Expand Up @@ -555,7 +555,19 @@ private bool IsRunningOnCircleCI()
return !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("CIRCLECI"));
}

private bool IsMain()
private bool IsMainOrDevelop()
{
return Environment.GetEnvironmentVariable("CIRCLE_BRANCH").ToLower() == "main";
var env = Environment.GetEnvironmentVariable("CIRCLE_BRANCH").ToLower();

if(env == "main")
{
return true;
}

if(env == "develop")
{
return true;
}

return false;
}

0 comments on commit bc25f4e

Please sign in to comment.