-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ca02ffd
Showing
16 changed files
with
3,224 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea | ||
.phpunit.result.cache | ||
.composer/ | ||
vendor/ |
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,11 @@ | ||
FROM minicli/php81 | ||
|
||
# Install Composer and set up application | ||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
|
||
RUN mkdir /application && chown -R php /application | ||
COPY . /application/ | ||
RUN cd /application && composer install | ||
|
||
ENTRYPOINT [ "php", "/application/minicli" ] | ||
CMD ["help"] |
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,5 @@ | ||
# Minicli GitHub Action Template | ||
|
||
This repository is an application template for building GitHub Actions with [Minicli](https://github.com/minicli/minicli). | ||
|
||
Please check [the official documentation](https://docs.minicli.dev) for more information on how to use this application template. |
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,9 @@ | ||
# action.yml | ||
name: 'GitHub Action Template' | ||
description: 'A template repository for building GitHub actions in PHP with Minicli' | ||
outputs: | ||
response: | ||
description: 'Output from command' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
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 @@ | ||
. |
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,14 @@ | ||
<?php | ||
|
||
namespace App\Command\Demo; | ||
|
||
use Minicli\App; | ||
use Minicli\Command\CommandController; | ||
|
||
class DefaultController extends CommandController | ||
{ | ||
public function handle(): void | ||
{ | ||
$this->getPrinter()->info('Run ./minicli help for usage help.'); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
namespace App\Command\Demo; | ||
|
||
use Minicli\Command\CommandController; | ||
use Minicli\Output\Filter\ColorOutputFilter; | ||
use Minicli\Output\Helper\TableHelper; | ||
|
||
class TableController extends CommandController | ||
{ | ||
public function handle(): void | ||
{ | ||
$this->getPrinter()->display('Testing Tables'); | ||
|
||
$table = new TableHelper(); | ||
$table->addHeader(['Header 1', 'Header 2', 'Header 3']); | ||
|
||
for($i = 1; $i <= 10; $i++) { | ||
$table->addRow([(string)$i, (string)rand(0, 10), "other string $i"]); | ||
} | ||
|
||
$this->getPrinter()->newline(); | ||
$this->getPrinter()->rawOutput($table->getFormattedTable(new ColorOutputFilter())); | ||
$this->getPrinter()->newline(); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace App\Command\Demo; | ||
|
||
use Minicli\Command\CommandController; | ||
|
||
class TestController extends CommandController | ||
{ | ||
public function handle(): void | ||
{ | ||
$name = $this->hasParam('user') ? $this->getParam('user') : 'World'; | ||
$this->getPrinter()->display(sprintf("Hello, %s!", $name)); | ||
|
||
print_r($this->getParams()); | ||
} | ||
} |
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 @@ | ||
{ | ||
"name": "minicli/github-action", | ||
"description": "Minicli GitHub Action Application Template", | ||
"license": "MIT", | ||
"homepage": "https://github.com/minicli/application", | ||
"keywords": ["action", "github", "command-line", "template"], | ||
"autoload": { | ||
"psr-4": { | ||
"App\\": "app/" | ||
} | ||
}, | ||
"require": { | ||
"minicli/minicli": "^3.0", | ||
"minicli/command-help": "^0.1.0" | ||
}, | ||
"require-dev": { | ||
"pestphp/pest": "^1.21" | ||
}, | ||
"scripts": { | ||
"test" : ["pest"] | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"pestphp/pest-plugin": true | ||
} | ||
} | ||
} |
Oops, something went wrong.