From aca044ce709687bffd5d847c8b9e839b5eeddfe5 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Fri, 8 Dec 2023 15:30:27 +0100 Subject: [PATCH] Run only UnitTests on Windows & MacOs in CI --- build/Build.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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;