From 1ef1489e0821a04f0479d4ee3d1e34d2590174ea Mon Sep 17 00:00:00 2001 From: SonataCI Date: Tue, 23 Jan 2024 16:12:50 +0000 Subject: [PATCH 1/2] DevKit updates --- .github/workflows/documentation.yaml | 4 ++-- .github/workflows/lint.yaml | 12 ++++++------ .github/workflows/qa.yaml | 14 +++++++------- .github/workflows/symfony-lint.yaml | 16 ++++++++-------- .github/workflows/test.yaml | 19 +++++++------------ Makefile | 2 +- 6 files changed, 31 insertions(+), 36 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 27f5ff7a0..0a58c1427 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.11 uses: actions/setup-python@v4 @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run DOCtor-RST uses: docker://oskarstark/doctor-rst diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e7939cbf4..8b77376bf 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,12 +24,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 extensions: mongodb, gd @@ -49,12 +49,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2, composer-normalize:2 env: @@ -70,7 +70,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install yamllint run: sudo apt-get install yamllint @@ -85,7 +85,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install required dependencies run: sudo apt-get update && sudo apt-get install libxml2-utils diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index 6a47b9400..46eb68145 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -24,12 +24,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 extensions: mongodb, gd @@ -49,12 +49,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 extensions: mongodb, gd @@ -65,7 +65,7 @@ jobs: dependency-versions: highest - name: Psalm - run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.2 + run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.3 rector: name: Rector @@ -74,12 +74,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 extensions: mongodb, gd diff --git a/.github/workflows/symfony-lint.yaml b/.github/workflows/symfony-lint.yaml index 8291ee221..2b1b5c82c 100644 --- a/.github/workflows/symfony-lint.yaml +++ b/.github/workflows/symfony-lint.yaml @@ -24,12 +24,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 @@ -48,12 +48,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 @@ -72,12 +72,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 @@ -96,12 +96,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none tools: composer:v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8152cb3ea..1c9dfa065 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -39,6 +39,7 @@ jobs: - '8.0' - '8.1' - '8.2' + - '8.3' dependencies: [highest] allowed-to-fail: [false] symfony-require: [''] @@ -48,22 +49,22 @@ jobs: dependencies: lowest allowed-to-fail: false variant: normal - - php-version: '8.2' + - php-version: '8.3' dependencies: highest allowed-to-fail: false symfony-require: 5.4.* variant: symfony/symfony:"5.4.*" - - php-version: '8.2' + - php-version: '8.3' dependencies: highest allowed-to-fail: false symfony-require: 6.3.* variant: symfony/symfony:"6.3.*" - - php-version: '8.2' + - php-version: '8.3' dependencies: highest allowed-to-fail: false symfony-require: 6.4.* variant: symfony/symfony:"6.4.*" - - php-version: '8.2' + - php-version: '8.3' dependencies: highest allowed-to-fail: false symfony-require: 7.0.* @@ -71,25 +72,19 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} coverage: pcov - tools: composer:v2 + tools: composer:v2, flex extensions: mongodb, gd - name: Add PHPUnit matcher run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Globally install symfony/flex - if: matrix.symfony-require != '' - run: | - composer global config --no-plugins allow-plugins.symfony/flex true - composer global require --no-progress --no-scripts --no-plugins symfony/flex - - name: Install variant if: matrix.variant != 'normal' && !startsWith(matrix.variant, 'symfony/symfony') run: composer require ${{ matrix.variant }} --no-update diff --git a/Makefile b/Makefile index 420682c4d..a5e077dd1 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ phpstan: .PHONY: phpstan psalm: - vendor/bin/psalm --php-version=8.2 + vendor/bin/psalm --php-version=8.3 .PHONY: psalm rector: From bcf9955fd3f65c42d940f1ed5c98573ae66068cd Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Tue, 23 Jan 2024 17:55:39 +0100 Subject: [PATCH 2/2] fix tests --- .../SonataMediaExtensionTest.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/DependencyInjection/SonataMediaExtensionTest.php b/tests/DependencyInjection/SonataMediaExtensionTest.php index d694cf433..041fe22c9 100644 --- a/tests/DependencyInjection/SonataMediaExtensionTest.php +++ b/tests/DependencyInjection/SonataMediaExtensionTest.php @@ -41,6 +41,7 @@ use Sonata\MediaBundle\Twig\MediaRuntime; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; +use Symfony\Component\DependencyInjection\Reference; class SonataMediaExtensionTest extends AbstractExtensionTestCase { @@ -486,7 +487,13 @@ public function testFallbackCDN(): void ], ]); - $this->assertContainerBuilderHasServiceDefinitionWithArgument('sonata.media.cdn.fallback', 0, 'sonata.media.cdn.cloudfront'); + $this->assertContainerBuilderHasServiceDefinitionWithArgument( + 'sonata.media.cdn.fallback', + 0, + new Reference( + 'sonata.media.cdn.cloudfront' + ) + ); } public function testReplicateFilesystem(): void @@ -500,8 +507,16 @@ public function testReplicateFilesystem(): void ], ]); - $this->assertContainerBuilderHasServiceDefinitionWithArgument('sonata.media.adapter.filesystem.replicate', 0, 'sonata.media.adapter.filesystem.s3'); - $this->assertContainerBuilderHasServiceDefinitionWithArgument('sonata.media.adapter.filesystem.replicate', 1, 'sonata.media.adapter.filesystem.local'); + $this->assertContainerBuilderHasServiceDefinitionWithArgument( + 'sonata.media.adapter.filesystem.replicate', + 0, + new Reference('sonata.media.adapter.filesystem.s3') + ); + $this->assertContainerBuilderHasServiceDefinitionWithArgument( + 'sonata.media.adapter.filesystem.replicate', + 1, + new Reference('sonata.media.adapter.filesystem.local') + ); } /**