forked from spiral/app
-
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.
* Restructures installer directory - Adds generators - Adds internal composer for running tests - Prepares code for using in tests * Splits Installer and Configurator into logical parts, which only are responsible for specific tasks. * Adds Output DTO to use in Generators for sending output to the application. * Puts console and exception generators into right place * Fixes queue connection in config * Adds link to the database configuration docs * Adds unit tests * Starts working on application installation tests * Fixes bugs and improves installer in tests * Fixes bugs and improves installer in tests * Adds events storage for logging all installation events and use them for assertions Adds first application test with assertions * Update twig templates * Fix namespaces in the composer.json * Fix ViewRenderer * Fix CS * Fix CS * Fix Exception Skeleton generator * Fix repository binding * Add middlewares generator in validators * Add CycleInterceptor * Add GuardInterceptor to the web app * Add data grid * Update dependencies * Add translator module * Fix CS * Check verbosity * Fix dependent questions * Fix RoadRunnerConfigGeneratorTest, remove test app after test fails * Fix locale in the twig template * Improve deleting directories, fix copy module files * Fix RoadRunnerBridge resources, fix tests deprecations * Add phpunit gh workflow * AppBootloader and RoutesBootloader is not required * Fix gh workflow * Add name, description to the composer.json * Add allow-plugins to the composer.json * Disable code coverage * Remove .github directory after installation * Add spiral/roadrunner-cli * Install dependencies in the test app * Run application tests * Improve WebTest, fix assertBootloaderRegistered * Add Plain PHP template engine * Add ConsoleTest, remove unused resources * Fix cs * Rename method from findById to getById * Fix PHPUnit schema * Add docs links * Add spiral/nyholm-bridge to the gRPC app * Fix grpc resources * Add spiral/nyholm-bridge * Remove AppBootloader from gRPC app * Add gRPC application test * Add requires from composer.json * Add grpc config with service * Temporarily enable tests output * Add grpc extension * Disable tests output * Add the ability to test modules * Add getResourcesPath to the ModuleInterface * Add test modules * Add template engines tests * Add validators, temporal bridge, translator tests * Fixes `error_reporting` argument - deactivate deprecations * Some improvements * Improves readme generator. Now it generates only information for selected packages and provide put information into different sections. * CS fix * Adds scaffolder for RoadRunner bridge package * Adds readme for Web and Cli applications --------- Co-authored-by: Maxim Smakouz <[email protected]>
- Loading branch information
1 parent
2179398
commit 2106ec0
Showing
417 changed files
with
12,101 additions
and
3,446 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,59 @@ | ||
name: phpunit | ||
|
||
on: | ||
push: | ||
branches: | ||
- installer | ||
pull_request: | ||
branches: | ||
- installer | ||
|
||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
working-directory: ./installer | ||
|
||
jobs: | ||
phpunit: | ||
name: PHP ${{ matrix.php }}-${{ matrix.os }}, ${{ matrix.stability }}) | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['8.1', '8.2'] | ||
os: ['ubuntu-latest'] | ||
stability: ['prefer-lowest', 'prefer-stable'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: pdo, pdo_sqlite, sockets, grpc | ||
tools: pecl | ||
|
||
- name: Validate Composer | ||
run: composer validate | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Restore Composer Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer | ||
|
||
- name: Install Dependencies | ||
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Execute Tests | ||
run: vendor/bin/phpunit |
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 |
---|---|---|
|
@@ -5,5 +5,6 @@ rr* | |
protoc-gen-php-grpc* | ||
.env | ||
.phpunit.result.cache | ||
.phpunit.cache | ||
.deptrac.cache | ||
.phpunit.cache/ |
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 was deleted.
Oops, something went wrong.
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,4 @@ | ||
composer.lock | ||
vendor | ||
Tests/App | ||
build |
This file was deleted.
Oops, something went wrong.
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,92 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Installer\Application\Cli; | ||
|
||
use Composer\Package\PackageInterface; | ||
use Installer\Application\Cli\Generator\Bootloaders; | ||
use Installer\Application\Cli\Generator\Skeleton; | ||
use Installer\Internal\Application\AbstractApplication; | ||
use Installer\Internal\Generator\GeneratorInterface; | ||
use Installer\Internal\Package; | ||
use Installer\Internal\Question\QuestionInterface; | ||
use Installer\Internal\Readme\Block\FileBlock; | ||
use Installer\Internal\Readme\Section; | ||
use Installer\Module\Console\Generator\Skeleton as ConsoleSkeleton; | ||
use Installer\Module\Dumper\Package as DumperPackage; | ||
use Installer\Module\Exception\Generator\Skeleton as ExceptionSkeleton; | ||
use Installer\Module\ExtMbString\Package as ExtMbStringPackage; | ||
use Installer\Module\Psr7Implementation\Nyholm\Package as NyholmPsr7Implementation; | ||
use Installer\Module\RoadRunnerBridge\Common\RoadRunnerCliPackage; | ||
|
||
/** | ||
* @psalm-import-type AutoloadRules from PackageInterface | ||
* @psalm-import-type DevAutoloadRules from PackageInterface | ||
*/ | ||
final class Application extends AbstractApplication | ||
{ | ||
/** | ||
* @param Package[] $packages | ||
* @param AutoloadRules $autoload | ||
* @param DevAutoloadRules $autoloadDev | ||
* @param GeneratorInterface[] $generators | ||
* @param QuestionInterface[] $questions | ||
*/ | ||
public function __construct( | ||
string $name = 'Cli', | ||
array $packages = [ | ||
new ExtMbStringPackage(), | ||
new NyholmPsr7Implementation(), | ||
new DumperPackage(), | ||
new RoadRunnerCliPackage(), | ||
], | ||
array $autoload = [ | ||
'psr-4' => [ | ||
'App\\' => 'app/src', | ||
], | ||
], | ||
array $autoloadDev = [ | ||
'psr-4' => [ | ||
'Tests\\' => 'tests', | ||
], | ||
], | ||
array $questions = [], | ||
array $generators = [ | ||
new Bootloaders(), | ||
new Skeleton(), | ||
new ConsoleSkeleton(), | ||
new ExceptionSkeleton(), | ||
], | ||
array $resources = [ | ||
':common:' => '', | ||
], | ||
array $commands = [], | ||
array $instructions = [] | ||
) { | ||
parent::__construct( | ||
name: $name, | ||
packages: $packages, | ||
autoload: $autoload, | ||
autoloadDev: $autoloadDev, | ||
questions: $questions, | ||
resources: $resources, | ||
generators: $generators, | ||
commands: $commands, | ||
readme: $instructions | ||
); | ||
} | ||
|
||
protected function getDefaultReadme(): array | ||
{ | ||
return \array_merge(parent::getDefaultReadme(), [ | ||
Section::Usage->value => [ | ||
new FileBlock(__DIR__ . '/readme/usage.md'), | ||
], | ||
|
||
Section::ConsoleCommands->value => [ | ||
new FileBlock(__DIR__ . '/readme/commands.md'), | ||
], | ||
]); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Installer\Application\Cli\Generator; | ||
|
||
use Installer\Internal\Generator\Context; | ||
use Installer\Internal\Generator\GeneratorInterface; | ||
|
||
final class Skeleton implements GeneratorInterface | ||
{ | ||
public function process(Context $context): void | ||
{ | ||
if (!$context->application->hasSkeleton()) { | ||
return; | ||
} | ||
|
||
if (\file_exists($context->applicationRoot . 'tests/Feature/.gitignore')) { | ||
\unlink($context->applicationRoot . 'tests/Feature/.gitignore'); | ||
} | ||
} | ||
} |
Oops, something went wrong.