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

Sylius 1.13 #199

Merged
merged 19 commits into from
Jun 10, 2024
Merged
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
60 changes: 25 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Build

on:
push: ~
push:
branches-ignore:
- 'dependabot/**'
pull_request: ~
release:
types: [created]
Expand All @@ -19,36 +21,31 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.0", "8.1"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.10", "~1.12.0"]
node: ["16.x"]
mysql: ["5.7", "8.0"]

exclude:
- sylius: "~1.11.10"
symfony: "^6.0"

php: ["8.1","8.2","8.3"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
php: ["8.1","8.2","8.3"]
php: ["8.1", "8.2", "8.3"]

symfony: ["^5.4", "^6.4"]
sylius: ["~1.12.0", "~1.13.0"]
node: ["20.x"]
mysql: ["8.0"]
env:
APP_ENV: test
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"

steps:
-
uses: actions/checkout@v2
uses: actions/checkout@v3

-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
extensions: intl, gd
tools: symfony
tools: flex, symfony
coverage: none

-
name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node }}"

Expand All @@ -70,54 +67,47 @@ jobs:
-
name: Install certificates
run: symfony server:ca:install

-
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
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

-
name: Cache Composer
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-

-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"

-
name: Restrict Sylius version
if: matrix.sylius != ''
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction

-
name: Install PHP dependencies
run: composer update --no-interaction
run: composer install --no-interaction
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

-
name: Install Behat driver
run: vendor/bin/bdi browser:google-chrome drivers

-
name: Get Yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

-
name: Cache Yarn
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
Expand All @@ -138,7 +128,7 @@ jobs:
name: Prepare test application assets
run: |
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && yarn build)
(cd tests/Application && yarn build:prod)

-
name: Prepare test application cache
Expand All @@ -162,7 +152,7 @@ jobs:

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

-
name: Run PHPSpec
Expand All @@ -178,7 +168,7 @@ jobs:

-
name: Upload Behat logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: Behat logs
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/bin/*
!/bin/.gitkeep

/drivers
/vendor/
/node_modules/
/composer.lock
Expand All @@ -13,3 +14,7 @@
/web/media

/.phpunit.result.cache
/phpunit.xml
/phpspec.yml
/phpstan.neon
/behat.yml
49 changes: 29 additions & 20 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ imports:
- tests/Behat/Resources/suites.yml

default:
formatters:
pretty:
verbose: true
paths: false
snippets: false

extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
Robertfausk\Behat\PantherExtension: ~

FriendsOfBehat\MinkDebugExtension\ServiceContainer\MinkDebugExtension:
FriendsOfBehat\MinkDebugExtension:
directory: etc/build
clean_start: false
screenshot: true
Expand All @@ -15,32 +22,32 @@ default:
files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"
base_url: "https://127.0.0.1:8080/"
default_session: symfony
javascript_session: chrome_headless
javascript_session: panther
sessions:
symfony:
symfony: ~
chrome_headless:
chromedriver:
chrome:
api_url: http://127.0.0.1:9222
validate_certificate: false
chrome:
selenium2:
browser: chrome
capabilities:
browserName: chrome
browser: chrome
version: ""
marionette: null # https://github.com/Behat/MinkExtension/pull/311
chrome:
switches:
- "start-fullscreen"
- "start-maximized"
- "no-sandbox"
extra_capabilities:
chrome_headless_second_session:
chrome:
api_url: http://127.0.0.1:9222
validate_certificate: false
panther:
panther:
options:
webServerDir: "%paths.base%/tests/Application/public"
manager_options:
connection_timeout_in_ms: 5000
request_timeout_in_ms: 120000
chromedriver_arguments:
- --log-path=etc/build/chromedriver.log
- --verbose
capabilities:
acceptSslCerts: true
acceptInsecureCerts: true
unexpectedAlertBehaviour: accept
firefox:
selenium2:
browser: firefox
show_auto: false

FriendsOfBehat\SymfonyExtension:
Expand All @@ -53,3 +60,5 @@ default:
FriendsOfBehat\SuiteSettingsExtension:
paths:
- "features"

SyliusLabs\SuiteTagsExtension: ~
39 changes: 26 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,35 @@
}
],
"require": {
"php": "^8.0",
Copy link
Member

Choose a reason for hiding this comment

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

IMO requirement for PHP version should stay

"sylius/sylius": "~1.11.2 || ~1.12.0",
"sylius/sylius": "~1.12.0 || ~1.13.0",
"friendsofsymfony/jsrouting-bundle": "^3.2"
},
"require-dev": {
"behat/behat": "^3.6",
"behat/mink-selenium2-driver": "^1.4",
"dbrekelmans/bdi": "^1.1",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.3",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0",
"friends-of-behat/mink-extension": "^2.5",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"friends-of-behat/mink-debug-extension": "^2.0",
"phpspec/phpspec": "^7.0",
"phpspec/phpspec": "^7.2",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^10.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"se/selenium-server-standalone": "^2.52",
"sylius-labs/coding-standard": "^4.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.15"
"robertfausk/behat-panther-extension": "^1.1",
"sylius-labs/coding-standard": "^4.2",
"sylius-labs/suite-tags-extension": "^0.2",
"symfony/debug-bundle": "^5.4 || ^6.4",
"symfony/dotenv": "^5.4 || ^6.4",
"symfony/runtime": "^5.4 || ^6.4",
"symfony/web-profiler-bundle": "^5.4 || ^6.4"
},
"prefer-stable": true,
"autoload": {
Expand All @@ -55,6 +56,12 @@
"Tests\\Sylius\\AdminOrderCreationPlugin\\": "tests/"
}
},
"autoload-dev": {
"psr-4": {
"spec\\Sylius\\AdminOrderCreationPlugin\\": "spec/"
},
"classmap": ["tests/Application/Kernel.php"]
},
"scripts": {
"analyse": [
"@composer validate --strict",
Expand All @@ -68,12 +75,18 @@
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false,
"symfony/flex": true
"phpstan/extension-installer": false,
"symfony/flex": false,
"symfony/runtime": true
}
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
},
"runtime": {
"project_dir": "tests/Application",
"dotenv_path": "tests/Application/.env"
}
}
}
2 changes: 0 additions & 2 deletions easy-coding-standard.neon

This file was deleted.

2 changes: 0 additions & 2 deletions easy-coding-standard.yml

This file was deleted.

18 changes: 18 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $config): void {
$config->import('vendor/sylius-labs/coding-standard/ecs.php');

$config->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$config->skip([
'**/var/*',
'**/node_modules/*',
]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Being unable to create order when item prices are not defined for chann
Given the store operates on a channel named "Web-US" in "USD" currency
And the store operates on a channel named "Web-EC" in "USD" currency
And the store operates on a channel named "Web-PW" in "USD" currency
And the store has a product "Stark Coat" priced at "$100" available in channel "Web-US" and channel "Web-EC"
And the store has a product "Stark Coat" priced at "$100.00" available in channel "Web-US" and channel "Web-EC"
And the store ships everywhere for free
And the store allows paying with "Cash on Delivery"
And there is a customer account "jon.snow@the-wall.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Feature: Creating order with different billing address

Background:
Given the store operates on a single channel in "United States"
And the store has a product "Stark Coat" priced at "$100"
And the store has a product "Lannister Banner" priced at "$40"
And the store has a product "Stark Coat" priced at "$100.00"
And the store has a product "Lannister Banner" priced at "$40.00"
And the store ships everywhere for free
And the store allows paying with "Cash on Delivery"
And there is a customer account "jon.snow@the-wall.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Feature: Creating order with multiple items

Background:
Given the store operates on a single channel in "United States"
And the store has a product "Stark Coat" priced at "$100"
And the store has a product "Lannister Banner" priced at "$40"
And the store has a product "Greyjoy Boat" priced at "$1000"
And the store has a product "Targaryen Shield" priced at "$200"
And the store has a product "Stark Coat" priced at "$100.00"
And the store has a product "Lannister Banner" priced at "$40.00"
And the store has a product "Greyjoy Boat" priced at "$1,000.00"
And the store has a product "Targaryen Shield" priced at "$200.00"
And the store ships everywhere for free
And the store allows paying with "Cash on Delivery"
And there is a customer account "jon.snow@the-wall.com"
Expand Down
Loading
Loading