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 #496

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5cabe69
Back to normal package.json from Sylius-Standard
Prometee May 13, 2024
40dc1cf
No migration in the test app so we can remove the config
Prometee May 13, 2024
63333ac
new bundles and sync the list from Sylius-Standard
Prometee May 13, 2024
797dcba
Avoid commiting the yarn.lock
Prometee May 13, 2024
08f278a
Remove older sylius versions
Prometee May 13, 2024
e6c2262
Update deps
Prometee May 13, 2024
e3549a0
Fix PHPSpec since TwigFunction is now final
Prometee May 13, 2024
654083e
Move to the right place
Prometee May 13, 2024
66bae23
Remove no more needed override (bdi will found the right binary autom…
Prometee May 13, 2024
54d0cf8
Update phpunit xsi namespace
Prometee May 13, 2024
6daa87e
Allow override phpstan config
Prometee May 13, 2024
b5d867c
Update behat config to use Panther
Prometee May 13, 2024
8546d82
Cleanup
Prometee May 13, 2024
4b899fe
Update requirement and cleanup already required by sylius/sylius
Prometee May 13, 2024
c4a444f
Update and cleanup to build Sylius 1.13 tests
Prometee May 13, 2024
59f5c8e
Cleanup and update to tests Sylius 1.13
Prometee May 13, 2024
d7189b7
Use Symfony runtime
Prometee May 13, 2024
5da41b5
Fix Kernel config
Prometee May 13, 2024
1c87a45
Update CS build
Prometee May 13, 2024
287b1d6
Update ecs config
Prometee May 13, 2024
74355b4
ECS fix
Prometee May 13, 2024
83d1251
Fix phpstan command line
Prometee May 13, 2024
95cf56f
Fix PHPStan and update conf
Prometee May 13, 2024
ed22228
Fix ECS
Prometee May 13, 2024
8736a52
Support for PantherDriver
Prometee May 13, 2024
4113108
Bring back Sylius 1.12 support
Prometee May 13, 2024
28175be
Fix ECS
Prometee May 13, 2024
684887b
Avoid testing too old php version
Prometee May 13, 2024
a537e69
Fix Behat scenario by using the right pathPrefix
Prometee May 13, 2024
3f61a71
Remove unecessary ignore
Prometee May 13, 2024
c138c28
Fix Behat, use ImageProvider instead of a raw uploader
Prometee May 13, 2024
f3a9b14
Remove unecessary Chrome boot
Prometee May 14, 2024
065a6d5
The env is loaded by dotenv thanks to the bootstrap file
Prometee May 14, 2024
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
File renamed without changes.
63 changes: 24 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,39 @@ on:

jobs:
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

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

strategy:
fail-fast: false
matrix:
php: ["8.0"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.0", "~1.12.0"]
node: ["^14.17.x"]
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"]

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

env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/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
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 @@ -73,80 +69,69 @@ 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 install --no-interaction --no-scripts
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') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-yarn-

-
name: Copy package.json.dist to package.json
if: matrix.sylius != ''
run: (cd tests/Application && cp package.json.\${{ matrix.sylius }}.dist package.json)

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

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

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

-
name: Prepare test application cache
Expand Down Expand Up @@ -174,11 +159,11 @@ jobs:

-
name: Run Behat
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
run: vendor/bin/behat --colors --strict -vvv --no-interaction -f progress || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun

-
name: Upload Behat logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: Behat logs
Expand All @@ -196,4 +181,4 @@ jobs:
SLACK_MESSAGE: ':x:'
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
37 changes: 13 additions & 24 deletions .github/workflows/coding_standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,43 @@ jobs:
tests:
runs-on: ubuntu-latest

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

strategy:
fail-fast: false
matrix:
php: ["8.0"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.0", "~1.12.0"]
node: ["^14.17.x"]
mysql: ["8.0"]

exclude:
- sylius: ~1.11.0
symfony: "^6.0"
php: ["8.1"]
symfony: ["^5.4", "^6.4"]
sylius: ["~1.13.0"]
node: ["20.x"]

env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/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
tools: symfony
tools: flex, symfony
coverage: none
-
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 != ''
Expand All @@ -74,10 +61,12 @@ jobs:
-
name: Install PHP dependencies
run: composer install --no-interaction
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

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

- name: Run ECS
run: vendor/bin/ecs
Expand All @@ -92,4 +81,4 @@ jobs:
SLACK_MESSAGE: ':x:'
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
31 changes: 16 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
/etc/build/*
!/etc/build/.gitignore

tests/Application/node_modules/

tests/Application/var/
!tests/Application/var/.gitkeep

tests/Application/web/*
!tests/Application/web/favicon.ico
!tests/Application/web/app.php
!tests/Application/web/app_dev.php
!tests/Application/web/app_test.php

/tests/Application/yarn.lock

/composer.lock

/etc/build/*
!/etc/build/.gitkeep
/.phpunit.result.cache
/phpunit.xml
/phpstan.neon
/phpspec.yml
/behat.yml
/drivers

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
48 changes: 28 additions & 20 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ 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:
directory: etc/build
Expand All @@ -15,33 +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
socket_timeout: 60
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 @@ -54,3 +60,5 @@ default:
FriendsOfBehat\SuiteSettingsExtension:
paths:
- "features"

SyliusLabs\SuiteTagsExtension: ~
Loading
Loading