From 5c31084c9e8e5f80a20678d69e577530e3aa8064 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Sun, 17 Sep 2023 18:32:03 +0700 Subject: [PATCH] Improve CI & Fixes for earlier symfony versions (#1) * improve CI * test on all branches * add name * symfony 6.0 fixes * symfony 6.0 fixes * add changelog --- .github/workflows/php.yml | 33 +++++++++++++++---- CHANGELOG.md | 6 ++++ .../RekalogikaPsr16SimpleCacheExtension.php | 5 ++- tests/Kernel.php | 2 +- 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index aa36d5f..3ceba77 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,8 +1,8 @@ -name: PHP Composer +name: Test on: push: - branches: [ "main" ] + branches: [ "*" ] pull_request: branches: [ "main" ] @@ -12,11 +12,26 @@ permissions: jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + operating-system: [ubuntu-latest] + php: [ '8.1', '8.2' ] + symfony: [ '6.*' ] + dep: [highest,lowest] + + runs-on: ${{ matrix.operating-system }} + + name: Symfony ${{ matrix.symfony }}, ${{ matrix.dep }} deps, PHP ${{ matrix.php }}, ${{ matrix.operating-system }} steps: - uses: actions/checkout@v3 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: intl + - name: Validate composer.json and composer.lock run: composer validate --strict @@ -30,7 +45,12 @@ jobs: ${{ runner.os }}-php- - name: Install dependencies - run: composer install --prefer-dist --no-progress + uses: ramsey/composer-install@v2 + with: + dependency-versions: ${{ matrix.dep }} + composer-options: --prefer-dist --no-progress + env: + SYMFONY_REQUIRE: ${{ matrix.symfony }} - name: Run psalm run: vendor/bin/psalm @@ -39,5 +59,6 @@ jobs: run: vendor/bin/phpstan analyse - name: Run phpunit - run: vendor/bin/phpunit --testdox -v - + run: | + export SYMFONY_DEPRECATIONS_HELPER='max[direct]=0' + vendor/bin/phpunit --testdox -v \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e62c05a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## 1.0.1 + +* Improve CI +* Fixes for earlier Symfony versions \ No newline at end of file diff --git a/src/DependencyInjection/RekalogikaPsr16SimpleCacheExtension.php b/src/DependencyInjection/RekalogikaPsr16SimpleCacheExtension.php index e5eb57c..36e4334 100644 --- a/src/DependencyInjection/RekalogikaPsr16SimpleCacheExtension.php +++ b/src/DependencyInjection/RekalogikaPsr16SimpleCacheExtension.php @@ -18,7 +18,10 @@ class RekalogikaPsr16SimpleCacheExtension extends Extension { - public function load(array $configs, ContainerBuilder $container) + /** + * @param array $configs + */ + public function load(array $configs, ContainerBuilder $container): void { $env = $container->getParameter('kernel.environment'); diff --git a/tests/Kernel.php b/tests/Kernel.php index ffa0eb4..4316058 100644 --- a/tests/Kernel.php +++ b/tests/Kernel.php @@ -25,7 +25,7 @@ public function registerBundles(): iterable ]; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { } }