Skip to content

Commit e903cec

Browse files
committed
fix(mcl): Fail job on nix-eval-jobs failure
1 parent 35d4f75 commit e903cec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/mcl/src/src/mcl/commands/ci_matrix.d

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ Package[] nixEvalJobs(string flakeAttrPrefix, string cachixUrl, bool doCheck = t
334334
errorf("Command `%s` failed with error:\n---\n%s\n---", commandString, errorMsg);
335335
}
336336

337+
bool jobFailed = false;
338+
337339
foreach (line; pipes.stdout.byLine)
338340
{
339341
if (line.indexOf("{") == -1)
@@ -347,6 +349,7 @@ Package[] nixEvalJobs(string flakeAttrPrefix, string cachixUrl, bool doCheck = t
347349
if (auto err = "error" in json)
348350
{
349351
logError((*err).str);
352+
jobFailed = true;
350353
continue; // drain the output
351354
}
352355

@@ -380,7 +383,8 @@ Package[] nixEvalJobs(string flakeAttrPrefix, string cachixUrl, bool doCheck = t
380383
logWarning(stderrLogs);
381384

382385
int status = wait(pipes.pid);
383-
enforce(status == 0, "Command `%s` failed with status %s".fmt(args, status));
386+
jobFailed = jobFailed || status != 0;
387+
enforce(!jobFailed, "Command `%s` failed with status %s".fmt(commandString, status));
384388

385389
return result;
386390
}

0 commit comments

Comments
 (0)