Skip to content

Commit

Permalink
close #33
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Oct 26, 2023
1 parent 19dac93 commit c70d210
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,21 @@ public function withRun(): RunnerInterface
{
$new = clone $this;
$jobs = $new->run->workflow()->jobs();
foreach ($jobs->graph()->toArray() as $node) {
$promises = $new->getPromises($node);
/** @var RunnerInterface[] $responses */
$responses = wait(all($promises));
foreach ($responses as $runner) {
$graph = $jobs->graph()->toArray();
if (count($graph) === count($jobs)) {
foreach ($graph as $node) {
$runner = runnerForJob($new, $node[0]);
$new->merge($new, $runner);
}
} else {
foreach ($graph as $node) {
$promises = $new->getPromises($node);
/** @var RunnerInterface[] $responses */
$responses = wait(all($promises));
foreach ($responses as $runner) {
$new->merge($new, $runner);
}
}
}

return $new;
Expand Down

0 comments on commit c70d210

Please sign in to comment.