Skip to content

Commit 74a8184

Browse files
committed
exclude GUI projects since they can't run headless
1 parent 3f54ab0 commit 74a8184

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/make.pas

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,29 @@ function ResolveDependency(const ADep: TDependency): string;
433433
end;
434434

435435
// ---------------------------------------------------------------------------
436-
// Determine whether an .lpi project is a test runner
436+
// Project classification helpers
437437
// ---------------------------------------------------------------------------
438438

439+
// A project is considered GUI if its .lpi lists LCL as a required package.
440+
// GUI projects cannot run headless in CI, so we skip them entirely.
441+
function IsGUIProject(const ALpiPath: string): Boolean;
442+
var
443+
Content: string;
444+
Filter: TRegExpr;
445+
begin
446+
Result := False;
447+
if not FileExists(ALpiPath) then
448+
Exit;
449+
Content := ReadFileToString(ALpiPath);
450+
Filter := TRegExpr.Create('<PackageName\s+Value="LCL"\s*/>');
451+
try
452+
Result := Filter.Exec(Content);
453+
finally
454+
Filter.Free;
455+
end;
456+
end;
457+
458+
// A console project is a test runner if its .lpr uses consoletestrunner.
439459
function IsTestProject(const ALpiPath: string): Boolean;
440460
var
441461
LprPath, Content: string;
@@ -478,10 +498,18 @@ procedure BuildAllProjects;
478498
List := FindAllFilesList(Target, '*.lpi');
479499
try
480500
for Each in List do
501+
begin
502+
if IsGUIProject(Each) then
503+
begin
504+
Log(CSI_Yellow, 'skip GUI project ' + Each);
505+
Continue;
506+
end;
507+
481508
if IsTestProject(Each) then
482509
RunTestProject(Each)
483510
else
484511
RunSampleProject(Each);
512+
end;
485513
finally
486514
List.Free;
487515
end;

0 commit comments

Comments
 (0)