Skip to content

Commit

Permalink
Try to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Jun 26, 2024
1 parent fee8dd2 commit bfee430
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 55 deletions.
36 changes: 8 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 8.1 ]
symfony: [ ^5.4, ^6.4 ]
php: [ "8.1" ]
symfony: [ "^5.4", "^6.4" ]

steps:
-
Expand Down Expand Up @@ -108,22 +108,13 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["7.4", "8.0", "8.1", "8.2", "8.3"]
php: ["8.0", "8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4"]
sylius: ["~1.10.0", "~1.11.0", "~1.12.0", "~1.13.0"]
sylius: ["~1.12.0", "~1.13.0"]
node: ["20.x"]
mysql: ["8.0"]

exclude:
-
sylius: "~1.10.0"
symfony: "^6.4"
-
sylius: "~1.11.0"
php: "7.4"
-
sylius: "~1.11.0"
symfony: "^6.4"
-
sylius: "~1.12.0"
php: "7.4"
Expand All @@ -133,9 +124,6 @@ jobs:
-
sylius: "~1.13.0"
php: "8.0"
-
php: "7.4"
symfony: "^6.4"
-
php: "8.0"
symfony: "^6.4"
Expand Down Expand Up @@ -205,16 +193,6 @@ jobs:
if: matrix.sylius != ''
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction

-
name: Fix build on Sylius 1.10
if: matrix.sylius == '~1.10.0'
run: |
composer require "nyholm/psr7" --no-update --no-scripts --no-interaction
-
name: Fix build on Sylius 1.11
if: matrix.sylius == '~1.11.0'
run: |
composer require "nyholm/psr7" --no-update --no-scripts --no-interaction
-
name: Fix build with PHP 8.3
if: matrix.php == '8.3'
Expand Down Expand Up @@ -292,6 +270,8 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: Behat logs for Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}
path: etc/build/
name: Logs for Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}
path: |
etc/build/
tests/Application/var/log
if-no-files-found: ignore
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^10.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"robertfausk/behat-panther-extension": "^1.1",
"sylius-labs/coding-standard": "^4.1",
Expand All @@ -52,6 +52,7 @@
},
"autoload-dev": {
"psr-4": {
"spec\\FluxSE\\SyliusPayumStripePlugin\\": "spec/",
"Tests\\FluxSE\\SyliusPayumStripePlugin\\": "tests/",
"Tests\\FluxSE\\SyliusPayumStripePlugin\\App\\": "tests/Application/src/"
}
Expand Down
22 changes: 2 additions & 20 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
namespace Tests\FluxSE\SyliusPayumStripePlugin\Application;

use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel;
use Sylius\Bundle\CoreBundle\SyliusCoreBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

/**
* @property string $environment
*/
final class Kernel extends BaseKernel
{
use MicroKernelTrait;
Expand Down Expand Up @@ -118,7 +114,7 @@ private function registerBundlesFromFile(string $bundlesFile): iterable
private function getConfigurationDirectories(): iterable
{
yield $this->getProjectDir() . '/config';
$syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION;
$syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusCoreBundle::MAJOR_VERSION . '.' . SyliusCoreBundle::MINOR_VERSION;
if (is_dir($syliusConfigDir)) {
yield $syliusConfigDir;
}
Expand All @@ -127,18 +123,4 @@ private function getConfigurationDirectories(): iterable
yield $symfonyConfigDir;
}
}

protected function build(ContainerBuilder $container)
{
// Fix APIPlatform issue during console initialisation
// Service "api_platform.error_listener": Parent definition "exception_listener" does not exist.
$sfVersion = sprintf('%d.%d', BaseKernel::MAJOR_VERSION, BaseKernel::MINOR_VERSION);
if ('4.4' !== $sfVersion) {
return;
}

if (false === $container->hasDefinition('exception_listener')) {
$container->setAlias('exception_listener', new Alias('console.error_listener'));
}
}
}
6 changes: 3 additions & 3 deletions tests/Application/config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
return;
} else {
// load all the .env files
(new Dotenv(true))->loadEnv(dirname(__DIR__) . '/.env');
(new Dotenv())->loadEnv(dirname(__DIR__) . '/.env');
}

$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
$_SERVER['APP_DEBUG'] ??= $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
3 changes: 0 additions & 3 deletions tests/Application/config/packages/validator.yaml

This file was deleted.

0 comments on commit bfee430

Please sign in to comment.