-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from MacPaw/develop
Release 1.0.1
- Loading branch information
Showing
30 changed files
with
884 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ main, develop ] | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: | ||
- '8.3' | ||
coverage: ['none'] | ||
symfony-versions: | ||
- '6.4.*' | ||
- '7.0.*' | ||
|
||
name: Test with PHP ${{ matrix.php }} Symfony ${{ matrix.symfony-versions }} ${{ matrix.description }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache/files | ||
key: ${{ matrix.php }}-${{ matrix.symfony-versions }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: xdebug | ||
extensions: xdebug | ||
|
||
- name: Add PHPUnit matcher | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Set composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony-versions }}-composer-${{ hashFiles('composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony-versions }}-composer | ||
|
||
- name: Update Symfony version | ||
if: matrix.symfony-versions != '' | ||
run: | | ||
composer require symfony/config:${{ matrix.symfony-versions }} --no-update --no-scripts | ||
composer require symfony/dependency-injection:${{ matrix.symfony-versions }} --no-update --no-scripts | ||
composer require symfony/http-kernel:${{ matrix.symfony-versions }} --no-update --no-scripts | ||
composer require symfony/cache:${{ matrix.symfony-versions }} --no-update --no-scripts | ||
composer require --dev symfony/yaml:${{ matrix.symfony-versions }} --no-update --no-scripts | ||
composer require --dev symfony/phpunit-bridge:${{ matrix.symfony-versions }} --no-update --no-scripts | ||
composer require --dev symfony/framework-bundle:${{ matrix.symfony-versions }} --no-update --no-scripts | ||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Run PHPUnit tests | ||
run: XDEBUG_MODE=coverage vendor/bin/phpunit | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,8 @@ | |
/phpunit.xml | ||
.phpunit.result.cache | ||
###< phpunit/phpunit ### | ||
|
||
/reports | ||
/coverage | ||
/tests/App/var | ||
/var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" | ||
colors="true" | ||
bootstrap="tests/bootstrap.php" | ||
cacheDirectory="var/cache/test/phpunit"> | ||
<php> | ||
<ini name="error_reporting" value="-1"/> | ||
<ini name="memory_limit" value="-1"/> | ||
<server name="APP_ENV" value="test" force="true"/> | ||
<server name="APP_DEBUG" value="0" force="true"/> | ||
<server name="SHELL_VERBOSITY" value="-1"/> | ||
<server name="SYMFONY_PHPUNIT_REMOVE" value=""/> | ||
<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="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/Unit</directory> | ||
</testsuite> | ||
<testsuite name="functional"> | ||
<directory>tests/Functional</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory>./src</directory> | ||
</include> | ||
<exclude> | ||
</exclude> | ||
</source> | ||
|
||
<coverage cacheDirectory="/tmp/phpunit-cache" | ||
includeUncoveredFiles="true" | ||
pathCoverage="false" | ||
ignoreDeprecatedCodeUnits="true" | ||
disableCodeCoverageIgnore="true"> | ||
<report> | ||
<clover outputFile="clover.xml"/> | ||
</report> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Macpaw\DoctrineAwsIamRdsAuthBundle\Factory; | ||
|
||
use Aws\Credentials\CredentialProvider; | ||
use Aws\Rds\AuthTokenGenerator; | ||
|
||
final readonly class AuthTokenGeneratorFactory | ||
{ | ||
public function __invoke(): AuthTokenGenerator | ||
{ | ||
return new AuthTokenGenerator( | ||
CredentialProvider::defaultProvider() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Macpaw\DoctrineAwsIamRdsAuthBundle\Tests\App; | ||
|
||
use Macpaw\DoctrineAwsIamRdsAuthBundle\DependencyInjection\DoctrineAwsIamRdsAuthExtension; | ||
use Macpaw\DoctrineAwsIamRdsAuthBundle\DoctrineAwsIamRdsAuthBundle; | ||
use Macpaw\DoctrineAwsIamRdsAuthBundle\Tests\App\dependencyInjection\PublicCompilerPass; | ||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpKernel\Kernel as BaseKernel; | ||
|
||
final class Kernel extends BaseKernel | ||
{ | ||
use MicroKernelTrait; | ||
|
||
protected function build(ContainerBuilder $container): void | ||
{ | ||
parent::build($container); | ||
} | ||
|
||
public function getProjectDir(): string | ||
{ | ||
return __DIR__; | ||
} | ||
|
||
protected function getContainerBuilder(): ContainerBuilder | ||
{ | ||
$builder = parent::getContainerBuilder(); | ||
$builder->addCompilerPass(new PublicCompilerPass()); | ||
|
||
return $builder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Macpaw\DoctrineAwsIamRdsAuthBundle\DoctrineAwsIamRdsAuthBundle; | ||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; | ||
|
||
return [ | ||
FrameworkBundle::class => ['all' => true], | ||
DoctrineAwsIamRdsAuthBundle::class => ['all' => true], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
framework: | ||
cache: | ||
app: cache.adapter.filesystem | ||
system: cache.adapter.filesystem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
doctrine_aws_iam_rds: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
framework: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
doctrine_aws_iam_rds: | ||
|
||
services: | ||
Macpaw\DoctrineAwsIamRdsAuthBundle\Aws\Token\RdsTokenProvider: | ||
public: true | ||
arguments: | ||
[ '@rds.authTokenGenerator', '@?' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
framework: | ||
test: true |
Oops, something went wrong.