Skip to content

Commit

Permalink
Merge branch '3.x' into support-nested-blocks-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ifox authored Oct 14, 2024
2 parents f0e1359 + 70da900 commit b244174
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 44 deletions.
43 changes: 16 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1, 8.0]
laravel: [9.*, 10.*, 11.*]
php: [8.3, 8.2, 8.1]
laravel: [10.*, 11.*]
dbal: [3.*, 4.*]
exclude:
- laravel: 9.*
dbal: 4.*
- laravel: 10.*
dbal: 4.*
- laravel: 10.*
php: 8.0
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 8.1
- laravel: 11.*
dbal: 3.*
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
Expand Down Expand Up @@ -128,15 +120,6 @@ jobs:
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update
composer install --prefer-dist --no-interaction --no-plugins
- name: Patch TestCase files for PHP < 8.1
run: |
if php -r 'exit(version_compare(PHP_VERSION, "8.1.0", "<") ? 0 : 1);'; then
for file in tests/integration/TestCase.php tests/Browser/BrowserTestCase.php; do
sed -i 's/protected function onNotSuccessfulTest(Throwable \$t): never/protected function onNotSuccessfulTest(Throwable \$t): void/' "$file";
echo "Patched $file for PHP < 8.1";
done
fi
- name: Setup Node.js
uses: actions/setup-node@v1
with:
Expand Down Expand Up @@ -164,11 +147,6 @@ jobs:
- name: Prepare Testbench Dusk
run: ./vendor/bin/testbench-dusk package:discover

- name: Set PHPUnit config for Laravel 9
if: matrix.laravel == '9.*'
run: |
cp phpunit-legacy.xml phpunit.xml
- name: Execute all tests
run: vendor/bin/phpunit --stop-on-error
env:
Expand All @@ -178,10 +156,21 @@ jobs:
with:
files: .github/clover.xml

- uses: actions/upload-artifact@v2
if: always()
- name: Replace asterisks in Laravel
run: echo "REPLACED_LARAVEL=${MATRIX_LARAVEL//\*/_}" >> $GITHUB_ENV
env:
MATRIX_LARAVEL: ${{ matrix.laravel }}

- name: Replace asterisks in DBAL
id: replace_dbal
run: echo "REPLACED_DBAL=${MATRIX_DBAL//\*/_}" >> $GITHUB_ENV
env:
MATRIX_DBAL: ${{ matrix.dbal }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: screenshots
name: screenshots-${{ matrix.os }}-${{ matrix.php }}-${{ env.REPLACED_LARAVEL }}-${{ env.REPLACED_DBAL }}
path: |
tests/Browser/screenshots/
tests/Browser/console/
35 changes: 18 additions & 17 deletions src/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use A17\Twill\Http\Middleware\ValidateBackHistory;
use A17\Twill\Services\MediaLibrary\Glide;
use A17\Twill\Facades\TwillRoutes;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
Expand All @@ -29,26 +29,27 @@ public function boot(): void
$this->registerRouteMiddlewares();
$this->app->bind(TwillRoutes::class);
$this->registerRouteMacros();
parent::boot();
}

public function map(Router $router): void
public function register()
{
\A17\Twill\Facades\TwillRoutes::registerRoutePatterns();

$this->mapInternalRoutes(
$router,
\A17\Twill\Facades\TwillRoutes::getRouteGroupOptions(),
\A17\Twill\Facades\TwillRoutes::getRouteMiddleware(),
\A17\Twill\Facades\TwillRoutes::supportSubdomainRouting()
);
$this->callAfterResolving(Router::class, function (Router $router) {
\A17\Twill\Facades\TwillRoutes::registerRoutePatterns();

$this->mapInternalRoutes(
$router,
\A17\Twill\Facades\TwillRoutes::getRouteGroupOptions(),
\A17\Twill\Facades\TwillRoutes::getRouteMiddleware(),
\A17\Twill\Facades\TwillRoutes::supportSubdomainRouting()
);

$this->mapHostRoutes(
$router,
\A17\Twill\Facades\TwillRoutes::getRouteGroupOptions(),
\A17\Twill\Facades\TwillRoutes::getRouteMiddleware(),
\A17\Twill\Facades\TwillRoutes::supportSubdomainRouting()
);
$this->mapHostRoutes(
$router,
\A17\Twill\Facades\TwillRoutes::getRouteGroupOptions(),
\A17\Twill\Facades\TwillRoutes::getRouteMiddleware(),
\A17\Twill\Facades\TwillRoutes::supportSubdomainRouting()
);
});
}

private function mapHostRoutes(
Expand Down

0 comments on commit b244174

Please sign in to comment.