PHP code example of sandermuller / boost-pipeline

1. Go to this page and download the library: Download sandermuller/boost-pipeline library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sandermuller / boost-pipeline example snippets


 declare(strict_types=1);

use SanderMuller\BoostPipeline\Config\Pipeline;
use SanderMuller\BoostPipeline\Phases\Defaults\{Refactoring, Formatting, Tests, Agent};
use SanderMuller\BoostPipeline\Phases\{StepCollection, Steps};
use SanderMuller\BoostPipeline\Steps\{Shell, Skill};

return Pipeline::configure()
    ->withSteps(function (Steps $steps): void {
        $steps->in(Refactoring::class)
            ->append(Shell::run('vendor/bin/rector process --dry-run'));

        // Neither of these feeds the other, so they share a position and run at once.
        $steps->in(Formatting::class)
            ->parallel(function (StepCollection $steps): void {
                $steps->append(Shell::run('vendor/bin/pint --test'));
                $steps->append(Shell::run('yarn lint-all'));
            });

        $steps->in(Tests::class)->append(Shell::run('yarn test:js'));

        $steps->in(Agent::class)
            ->append(Skill::run('/evaluate', instruction: 'Fix what the checks above reported.'));
    });

return [
    'pr' => Pipeline::configure()
        ->withPurpose('Confirm the branch is ready to review.')
        ->…,
    'release' => Pipeline::configure()
        ->withPurpose('Confirm the tag is safe to publish.')
        ->…,
];

$steps->in(Formatting::class)
    ->append(
        Shell::run('vendor/bin/pint --test')->tagged('backend')
    )
    ->append(
        Shell::run('yarn lint-all')->tagged('frontend')
    );

$steps->in(Formatting::class)
    ->append(
        Shell::run('vendor/bin/pint')->mutating()
    );

// config/boost-pipeline.php
use SanderMuller\BoostPipeline\Http\LoopbackOnly;

return [
    'ui' => [
        'enabled' => env('BOOST_PIPELINE_UI', false),
        'path' => 'boost-pipelines',
        'middleware' => ['web', LoopbackOnly::class],
    ],
];

$steps->in(Agent::class)
    ->append(
        Skill::run('/eye-verification')
            ->proving('find storage/verify -name "*.png" -newer .git/HEAD | grep -q .')
    );

$database = substr('myapp_phpunit_'.preg_replace('/[^A-Za-z0-9_]/', '_', basename(base_path())),
0, 64);

$steps->in(Tests::class)->append(
    Shell::run('php artisan test', id: 'phpunit')->withEnv(['DB_DATABASE' => $database]),
);
bash
php artisan pipeline:list
bash
php artisan pipeline:history                    # the recent runs, newest first
php artisan pipeline:history --run=r-4f2a       # one run, step by step
php artisan pipeline:history --pipeline=release --limit=5