Skip to content

Commit

Permalink
Avoid duplicate ctest runs during Github CI runs
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Dec 2, 2020
1 parent 815cd44 commit 0ccfabf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ string ObjectDirectory
}
}

bool IsRunningInGithub()
{
return !string.IsNullOrEmpty(EnvironmentVariable<string>("GITHUB_WORKFLOW", ""));
}

var MsBuildSettings = new DotNetCoreMSBuildSettings { MaxCpuCount = 0 };

//
Expand Down Expand Up @@ -303,6 +308,7 @@ Task("Binplace-CMake")

Task("Test-CMake")
.WithCriteria(() => IsRunningOnUnix())
.WithCriteria(() => !IsRunningInGithub()) // github pipelines already test this via `make cmake-test`
.IsDependentOn("Binplace-CMake")
.Does(() =>
{
Expand All @@ -327,6 +333,8 @@ Task("Test-CMake")
});


// This does *almost* the same thing as Test-CMake but using the Mlos.TestRun.proj to invoke the tests instead of ctest.
//
Task("Run-CMake-UnitTests")
.IsDependentOn("Binplace-CMake")
.WithCriteria(() => IsRunningOnUnix())
Expand Down

0 comments on commit 0ccfabf

Please sign in to comment.