Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support newer Sylius and Symfony versions #49

Open
wants to merge 4 commits into
base: 0.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 8 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,15 @@ jobs:
tests:
runs-on: ubuntu-18.04

name: "PHP ${{ matrix.php }}, MySQL ${{ matrix.mysql }}"
name: "PHP ${{ matrix.php }}, MySQL ${{ matrix.mysql }}, Sylius ${{ matrix.sylius }}"

strategy:
fail-fast: false
matrix:
php: [7.4, 7.3]
php: [8.0, 8.1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should test 7.4 and 8.1

Copy link
Author

@Zales0123 Zales0123 Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, we should change the required PHP version to ^8.0 as 7.4 is no longer supported in Sylius 1.11 💃

node: [10.x]
mysql: [5.7, 8.0]

exclude:
- # PHP 7.3 does not support "caching_sha2_password" authentication plugin which is a default one in MySQL 8.0
php: 7.3
mysql: 8.0
sylius: [1.11.*, 1.12.*]

env:
APP_ENV: test
Expand Down Expand Up @@ -79,10 +75,6 @@ jobs:
name: Run Chrome Headless
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &

-
name: Run webserver
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)

-
name: Get Composer cache directory
id: composer-cache
Expand All @@ -97,6 +89,10 @@ jobs:
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-

-
name: Require Sylius version
run: composer require sylius/sylius:"${{ matrix.sylius }}" --no-update

-
name: Install PHP dependencies
run: composer install --no-interaction
Expand All @@ -115,50 +111,14 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-yarn-

-
name: Install JS dependencies
run: (cd tests/Application && yarn install)

-
name: Prepare test application database
run: |
(cd tests/Application && bin/console doctrine:database:create -vvv)
(cd tests/Application && bin/console doctrine:schema:create -vvv)

-
name: Prepare test application assets
run: |
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && yarn build)

-
name: Prepare test application cache
run: (cd tests/Application && bin/console cache:warmup -vvv)

-
name: Load fixtures in test application
run: (cd tests/Application && bin/console sylius:fixtures:load -n)

-
name: Validate composer.json
run: composer validate --ansi --strict

-
name: Validate database schema
run: (cd tests/Application && bin/console doctrine:schema:validate)

-
name: Run php-cs-fixer
name: Run php-cs-fixer
run: vendor/bin/php-cs-fixer fix --verbose --diff --dry-run

-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/

-
name: Run PHPSpec
run: vendor/bin/phpspec run --ansi -f progress --no-interaction

-
name: Run PHPUnit
run: vendor/bin/phpunit --colors=always
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.idea

.php_cs.cache
.php-cs-fixer.cache
31 changes: 16 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"description": "Producer for synchronization products with sulu.",
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"php": "^7.4 || ^8.0",

"sylius/sylius": "^1.8",
"symfony/messenger": "^4.4|^5.0",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/serializer": "^4.4|^5.0"
"sylius/sylius": "1.11.* || 1.12.*",
"symfony/messenger": "^4.4 || ^5.4 || ^6.0",
"symfony/config": "^4.4 || ^5.4 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
"symfony/serializer": "^4.4 || ^5.4 || ^6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"friendsofphp/php-cs-fixer": "^2.15 || ^3.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand All @@ -24,13 +24,11 @@
"jangregor/phpstan-prophecy": "^1.0",
"thecodingmachine/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^8.2",
"symfony/browser-kit": "^4.4 || ^5.0",
"symfony/dotenv": "^4.4 || ^5.0",
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.0",
"symfony/dotenv": "^4.4 || ^5.4 || ^6.0",
"phpstan/extension-installer": "^1.0",
"sensiolabs/security-checker": "^6.0",
"symfony/intl": "^4.4 || ^5.0",
"symfony/web-profiler-bundle": "^4.4 || ^5.0",
"symfony/web-server-bundle": "^4.4 || ^5.0"
"symfony/intl": "^4.4 || ^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^4.4 || ^5.4 || ^6.0"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +38,10 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": false
}
},
"scripts": {
"post-install-cmd": [
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ parameters:

ignoreErrors:
- '/Parameter #1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension::processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./'
- '/Call to an undefined method Sylius\\Component\\User\\Model\\UserInterface\:\:isAccountNonExpired\(\)\./'
- '/Call to an undefined method Sylius\\Component\\User\\Model\\UserInterface\:\:isAccountNonLocked\(\)\./'
- '/Call to an undefined method Sylius\\Component\\User\\Model\\UserInterface\:\:isCredentialsNonExpired\(\)\./'
2 changes: 1 addition & 1 deletion src/Command/BaseSynchronizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

abstract class BaseSynchronizeCommand extends Command
{
const BULK_SIZE = 50;
public const BULK_SIZE = 50;

/**
* @var EntityManagerInterface
Expand Down