From 0ccfabf4d09a26e673e784308f88a9fe4c4d171a Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 2 Dec 2020 14:39:28 -0600 Subject: [PATCH] Avoid duplicate ctest runs during Github CI runs Fixes #196 --- build.cake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.cake b/build.cake index 46e5340c8e..ded01fd330 100644 --- a/build.cake +++ b/build.cake @@ -29,6 +29,11 @@ string ObjectDirectory } } +bool IsRunningInGithub() +{ + return !string.IsNullOrEmpty(EnvironmentVariable("GITHUB_WORKFLOW", "")); +} + var MsBuildSettings = new DotNetCoreMSBuildSettings { MaxCpuCount = 0 }; // @@ -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(() => { @@ -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())