Skip to content

Commit

Permalink
feat(o10r-symfony-template-145): Upgrade MacPaw/doctrine-aws-iam-rds-…
Browse files Browse the repository at this point in the history
…auth-bundle for symfony 7 support
  • Loading branch information
serhiidonii committed May 28, 2024
1 parent 2b3404d commit ad4bd03
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 26 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ jobs:
symfony-versions:
- '6.4.*'
- '7.0.*'
include:
- php: '8.3'
symfony-versions: '^6.4'
coverage: 'none'

name: PHP ${{ matrix.php }} Symfony ${{ matrix.symfony-versions }} ${{ matrix.description }}
name: Test with PHP ${{ matrix.php }} Symfony ${{ matrix.symfony-versions }} ${{ matrix.description }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -36,7 +32,8 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}
coverage: xdebug
extensions: xdebug

- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
Expand Down Expand Up @@ -67,5 +64,4 @@ jobs:
run: composer install

- name: Run PHPUnit tests
run: vendor/bin/phpunit
if: matrix.coverage == 'none'
run: XDEBUG_MODE=coverage vendor/bin/phpunit
24 changes: 24 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
pull_request:
push:
branches: [ main, develop ]

jobs:
security-checker:
name: Security checker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2

- name: Install dependencies
run: composer install --no-progress --no-interaction --prefer-dist

- name: Download local-php-security-checker
run: curl -s -L -o local-php-security-checker https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64

- name: Run local-php-security-checker
run: chmod +x local-php-security-checker && ./local-php-security-checker
2 changes: 1 addition & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
_defaults:
autowire: true
autoconfigure: true
public: true
public: false

Macpaw\DoctrineAwsIamRdsAuthBundle\Factory\AuthTokenGeneratorFactory: ~

Expand Down
19 changes: 5 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,26 @@
<server name="SYMFONY_PHPUNIT_VERSION" value="10"/>
<server name="RDS_TOKEN_LIFETIME_MINUTES" value="10"/>
<server name="RDS_TOKEN_CACHE_LIFETIME_SECONDS" value="3600"/>
<server name="KERNEL_CLASS" value="App\Kernel"/>
<server name="APP_SECRET" value="someString!"/>
<server name="AWS_REGION" value="us-west-1"/>
<server name="USE_IAM" value="true"/>
<server name="KERNEL_CLASS" value="App\Kernel"/>
<!-- https://github.com/phpDocumentor/TypeResolver/issues/148#issuecomment-1005542099 -->
<server name="SYMFONY_PHPUNIT_REQUIRE" value="phpdocumentor/type-resolver:1.6"/>
</php>
<testsuites>
<testsuite name="unit">
<directory>tests/PHPUnit/Unit</directory>
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="functional">
<directory>tests/PHPUnit/Functional</directory>
</testsuite>
<testsuite name="integration">
<directory>tests/PHPUnit/Integration</directory>
<directory>tests/Functional</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory suffix="Exception.php">src</directory>
<directory>src/Infrastructure/Migrations</directory>
<directory>src/Infrastructure/DataFixtures</directory>
<directory>src/Infrastructure/Exception</directory>
<directory>src/Component/DB/Exception</directory>
<directory>src/Domain/Exception</directory>
<file>src/Kernel.php</file>
</exclude>
</source>

Expand All @@ -53,7 +44,7 @@
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="true">
<report>
<php outputFile="reports/merge/phpunit.cov"/>
<clover outputFile="clover.xml"/>
</report>
</coverage>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\DependencyInjection\Container;

abstract class AbstractFunctionalTest extends KernelTestCase
abstract class AbstractFunctional extends KernelTestCase
{
protected static function getKernelClass(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
use Macpaw\DoctrineAwsIamRdsAuthBundle\Cache\CacheStorageInterface;
use Macpaw\DoctrineAwsIamRdsAuthBundle\Doctrine\Driver\IamDecorator;
use Macpaw\DoctrineAwsIamRdsAuthBundle\Doctrine\Driver\IamMiddleware;
use Macpaw\DoctrineAwsIamRdsAuthBundle\Tests\Functional\AbstractFunctionalTest;
use Macpaw\DoctrineAwsIamRdsAuthBundle\Tests\Functional\AbstractFunctional;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;

final class DIExtensionTest extends AbstractFunctionalTest
final class DIExtension extends AbstractFunctional
{
public function testRdsTokenProviderInit(): void
{
Expand Down

0 comments on commit ad4bd03

Please sign in to comment.