diff --git a/build/Build.cs b/build/Build.cs index 7e2a885..49ee835 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -50,7 +50,21 @@ public T From() public Solution CurrentSolution => From().Solution; - public IEnumerable TestProjects => CurrentSolution.GetAllProjects("*Tests*"); + public bool IsMacOs => + System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX); + + public bool IsWindows => + System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows); + + public IEnumerable UnitTests => + CurrentSolution.GetAllProjects("*UnitTests"); + + public IEnumerable ExecutionTests => + CurrentSolution.GetAllProjects("*ExecutionTests"); + + // Run only unit tests in CI on Windows & MacOS beecause execution tests take a while. + public IEnumerable TestProjects => + IsServerBuild && (IsMacOs || IsWindows) ? UnitTests : UnitTests.Concat(ExecutionTests); bool IUseCsharpier.UseGlobalTool => false; bool IUseFantomas.UseGlobalTool => false;