Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
108 changes: 50 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ jobs:
env:
APP_ENV: test
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"

steps:
-
uses: actions/checkout@v4

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

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

-
name: Shutdown default MySQL
run: sudo service mysql stop

-
-
name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
with:
Expand All @@ -63,24 +63,16 @@ jobs:
-
name: Output PHP version for Symfony CLI
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version

-
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 "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

-
name: Cache Composer
uses: actions/cache@v4
Expand All @@ -89,35 +81,33 @@ jobs:
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-

-
name: Configure global composer
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.2.2"


-
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:^2.4"
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
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}


-
name: Run unit tests
run: vendor/bin/phpunit --colors=always --testsuite=unit

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

-
name: Cache Yarn
uses: actions/cache@v4
Expand All @@ -126,60 +116,62 @@ jobs:
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-yarn-

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

run: (cd vendor/sylius/test-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)
(vendor/bin/console doctrine:database:create -vvv)
(vendor/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:prod)

vendor/bin/console assets:install -vvv
(cd vendor/sylius/test-application && yarn build)
-
name: Prepare test application cache
run: (cd tests/Application && bin/console cache:warmup -vvv)

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

run: vendor/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: Validate container
run: vendor/bin/console lint:container
-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/

name: Run Non-unit PHPUnit tests
run: vendor/bin/phpunit --colors=always --testsuite=non-unit
-
name: Run PHPSpec
run: vendor/bin/phpspec run --ansi -f progress --no-interaction

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 PHPUnit
run: vendor/bin/phpunit --colors=always

name: Run webserver
run: symfony server:start --port=8080 --daemon
-
name: Run Behat
run: vendor/bin/behat --colors --strict -vvv --no-interaction -f progress || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --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@v4
if: failure()
with:
name: Behat logs
name: "Behat logs - ${{ matrix.sylius }}-${{ github.run_id }}-${{ github.run_number }}"
path: etc/build/
if-no-files-found: ignore
compression-level: 6
overwrite: true
4 changes: 4 additions & 0 deletions assets/admin/controllers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"controllers": [],
"entrypoints": []
}
4 changes: 4 additions & 0 deletions assets/shop/controllers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"controllers": [],
"entrypoints": []
}
37 changes: 6 additions & 31 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@ 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 @@ -22,43 +15,25 @@ 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: panther
javascript_session: chrome
sessions:
symfony:
symfony: ~
chromedriver:
chrome:
api_url: http://127.0.0.1:9222
validate_certificate: false
chrome_headless_second_session:
chrome:
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
show_auto: false

FriendsOfBehat\SymfonyExtension:
bootstrap: tests/Application/config/bootstrap.php
bootstrap: vendor/sylius/test-application/config/bootstrap.php
kernel:
class: Tests\Acme\SyliusExamplePlugin\Application\Kernel
class: Sylius\TestApplication\Kernel

FriendsOfBehat\VariadicExtension: ~

SyliusLabs\SuiteTagsExtension: ~

FriendsOfBehat\SuiteSettingsExtension:
paths:
- "features"

SyliusLabs\SuiteTagsExtension: ~
45 changes: 0 additions & 45 deletions bin/create_node_symlink.php

This file was deleted.

Loading