diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index d472ba5..2643f97 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -436,6 +436,29 @@ function ResolveDependency(const ADep: TDependency): string; // Determine whether an .lpi project is a test runner // --------------------------------------------------------------------------- +// Project classification helpers +// --------------------------------------------------------------------------- + +// A project is considered GUI if its .lpi lists LCL as a required package. +// GUI projects cannot run headless in CI, so we skip them entirely. +function IsGUIProject(const ALpiPath: string): Boolean; +var + Content: string; + Filter: TRegExpr; +begin + Result := False; + if not FileExists(ALpiPath) then + Exit; + Content := ReadFileToString(ALpiPath); + Filter := TRegExpr.Create(''); + try + Result := Filter.Exec(Content); + finally + Filter.Free; + end; +end; + +// A console project is a test runner if its .lpr uses consoletestrunner. function IsTestProject(const ALpiPath: string): Boolean; var LprPath, Content: string; @@ -478,10 +501,18 @@ procedure BuildAllProjects; List := FindAllFilesList(Target, '*.lpi'); try for Each in List do + begin + if IsGUIProject(Each) then + begin + Log(CSI_Yellow, 'skip GUI project ' + Each); + Continue; + end; + if IsTestProject(Each) then RunTestProject(Each) else RunSampleProject(Each); + end; finally List.Free; end;