Skip to content

Commit

Permalink
SDK-4691: Added PHP 8.2 to CI check & unsupport PHP 7.4 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4onok authored Oct 6, 2023
1 parent 6252761 commit 9a8dece
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
fail-fast: false
matrix:
php-version: [
'7.4'
'7.4',
'8.2'
]

steps:
Expand Down Expand Up @@ -52,7 +53,12 @@ jobs:
run: composer --version

- name: Composer install
run: composer install
run: |
if [[ ${{ matrix.php-version }} == '8.2' ]]; then
composer update --prefer-stable --optimize-autoloader
else
composer install --optimize-autoloader
fi
- name: Container lint
run: bin/console lint:container
Expand Down
2 changes: 1 addition & 1 deletion config/checkers.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
# PHP version checker. Must be only major versions. Example: [5, 7, 8]
php_version_checker_allowed_php_major_versions: ['7', '8']
php_version_checker_allowed_php_major_versions: ['8']
php_version_checker_sdk_php_major_versions: '%php_version_checker_allowed_php_major_versions%'

php_version_checker_doc_url: https://docs.spryker.com/docs/scos/dev/guidelines/keeping-a-project-upgradable/upgradability-guidelines/php-version.html
Expand Down
5 changes: 3 additions & 2 deletions src/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ protected static function box(string $func, ...$args)
}

static::$lastError = null;

set_error_handler([static::class, 'handleError']);
/** @var callable $callback */
$callback = [static::class, 'handleError'];
set_error_handler($callback);
try {
return $func(...$args);
} finally {
Expand Down
4 changes: 2 additions & 2 deletions tests/Acceptance/Checker/PhpVersionCheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PhpVersionCheckerTest extends ApplicationTestCase
*/
public function testReturnSuccessOnValidProject(): void
{
$commandTester = $this->createCommandTester(TestHelper::VALID_PROJECT_PATH, ['PROJECT_PHP_VERSION' => '7.3.4']);
$commandTester = $this->createCommandTester(TestHelper::VALID_PROJECT_PATH, ['PROJECT_PHP_VERSION' => '8.1']);
$commandTester->execute(['--checkers' => PhpVersionChecker::NAME]);

$commandTester->assertCommandIsSuccessful();
Expand Down Expand Up @@ -66,7 +66,7 @@ public function testReturnViolationWhenProjectHasIssues(): void
| 5 | Not all the targets have same PHP versions | Current php version $phpVersion: - |
| | | tests/Acceptance/_data/InvalidProject/composer.json: - |
| | | tests/Acceptance/_data/InvalidProject/deploy**.yml: - |
| | | SDK php versions: php7, php8 |
| | | SDK php versions: php8 |
+---+-----------------------------------------------------------------------------+--------------------------------------------------------+
Read more: https://docs.spryker.com/docs/scos/dev/guidelines/keeping-a-project-upgradable/upgradability-guidelines/php-version.html
Expand Down
2 changes: 1 addition & 1 deletion tests/Acceptance/_data/ValidProject/deploy.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tag: 'dev'

environment: docker.dev
image:
tag: spryker/php:7.4-alpine3.12
tag: spryker/php:8.1-alpine3.12
php:
enabled-extensions:
- blackfire
Expand Down
3 changes: 2 additions & 1 deletion tests/Acceptance/_data/ValidProject/deploy.stag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ namespace: spryker_b2c_dev
tag: 'stag'

environment: docker.staging
image: spryker/php:7.4-alpine3.12
image:
tag: spryker/php:8.2-alpine3.12

composer:
mode: ''
Expand Down
2 changes: 1 addition & 1 deletion tests/Acceptance/_data/ValidProject/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tag: '1.0'

environment: docker.production
image:
tag: spryker/php:7.4-alpine3.12
tag: spryker/php:8.0-alpine3.12
php:
ini:
"opcache.revalidate_freq": 0
Expand Down

0 comments on commit 9a8dece

Please sign in to comment.