-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add grouping of output in GitHub Actions
- Loading branch information
1 parent
15d7599
commit 5a2bed6
Showing
10 changed files
with
98 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace GrumPHP\IO; | ||
|
||
use Symfony\Component\Console\Output\ConsoleSectionOutput; | ||
|
||
class GitHubActionsIO extends ConsoleIO | ||
{ | ||
public function startGroup(string $title): void | ||
{ | ||
$this->write('::group::' . $title); | ||
parent::startGroup($title); | ||
} | ||
|
||
public function endGroup(): void | ||
{ | ||
parent::endGroup(); | ||
$this->write('::endgroup::'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace GrumPHP\IO; | ||
use OndraM\CiDetector\Ci\GitHubActions; | ||
use OndraM\CiDetector\CiDetector; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class IOFactory | ||
{ | ||
public function __construct(private CiDetector $ciDetector) | ||
{ | ||
} | ||
|
||
public function create(InputInterface $input, OutputInterface $output): IOInterface | ||
{ | ||
if ($this->ciDetector->isCiDetected()) { | ||
$platform = $this->ciDetector->detect(); | ||
|
||
if ($platform instanceof GitHubActions) { | ||
return new GitHubActionsIO($input, $output); | ||
} | ||
} | ||
|
||
return new ConsoleIO($input, $output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters