Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/make.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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('<PackageName\s+Value="LCL"\s*/>');
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;
Expand Down Expand Up @@ -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;
Expand Down
Loading