Skip to content
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
9 changes: 3 additions & 6 deletions .github/workflows/analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- 8.3
symfony:
- '6.4.*'
- '7.2.*'
- '7.3.*'
env:
APP_ENV: test
steps:
Expand Down Expand Up @@ -59,11 +59,11 @@ jobs:
id: end-of-setup
-
name: 'ECS - Run'
run: 'if [ -f ruleset/ecs.php ]; then vendor/bin/ecs check src/ tests/Behat/ --no-progress-bar -c ruleset/ecs.php ; else echo Ecs ruleset file does not exist, skipping step ; fi'
run: 'if [ -f ruleset/ecs.php ]; then vendor/bin/ecs check --no-progress-bar -c ruleset/ecs.php ; else echo Ecs ruleset file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
-
name: 'PHPStan - Run'
run: 'if [ -f ruleset/phpstan.neon ]; then vendor/bin/phpstan analyse -c ruleset/phpstan.neon src/ ; else echo PHPStan ruleset file does not exist, skipping step ; fi'
run: 'if [ -f ruleset/phpstan.neon ]; then vendor/bin/phpstan analyse -c ruleset/phpstan.neon ; else echo PHPStan ruleset file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
-
name: 'PHPSpec - Run'
Expand All @@ -77,6 +77,3 @@ jobs:
name: 'GrumPHP - Run'
run: 'if [ -f grumphp.yml ]; then vendor/bin/grumphp run ; else echo Grumphp ruleset file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
-
uses: symfonycorp/security-checker-action@v3
if: 'always() && steps.end-of-setup.outcome == ''success'''
41 changes: 5 additions & 36 deletions .github/workflows/sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ jobs:
matrix:
php:
- 8.2
- 8.3
- 8.4
sylius:
- 2.0.0
- 2.1.0
symfony:
- 6.4
- 7.2
- 7.3
node:
- 20.x
env:
Expand Down Expand Up @@ -78,47 +79,15 @@ jobs:
-
name: 'Install Sylius-Standard and Plugin'
run: 'make install -e SYLIUS_VERSION=${{ matrix.sylius }} SYMFONY_VERSION=${{ matrix.symfony }} PHP_VERSION=${{ matrix.php }}'
-
name: 'Output PHP version for Symfony CLI'
working-directory: ./tests/Application
run: 'php -v | head -n 1 | awk ''{ print $2 }'' > .php-version'
-
name: 'Install certificates'
working-directory: ./tests/Application
run: 'symfony server:ca:install'
-
name: 'Run Chrome headless'
working-directory: ./tests/Application
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=''*'' https://127.0.0.1 > /dev/null 2>&1 &'
-
name: 'Run webserver'
working-directory: ./tests/Application
run: 'symfony server:start --port=8080 --dir=public --daemon'
id: end-of-setup-sylius
-
name: 'Doctrine Schema Validate - Run'
working-directory: ./tests/Application
run: 'php bin/console doctrine:schema:validate --skip-sync'
run: 'vendor/bin/console doctrine:schema:validate --skip-sync'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Run PHPUnit'
run: 'make phpunit'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Configure Behat'
run: 'make behat-configure'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Run behat'
working-directory: ./tests/Application
run: 'vendor/bin/behat --strict --no-interaction -f progress || vendor/bin/behat --strict -vvv --no-interaction --rerun'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
path: ./tests/Application/etc/build

services:
mariadb:
image: 'mariadb:10.4.11'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
/.phpunit.result.cache

/.idea/

/tests/TestApplication/.env.local
/tests/TestApplication/.env.*.local
/var/
76 changes: 14 additions & 62 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,89 +1,41 @@
.DEFAULT_GOAL := help
SHELL=/bin/bash
COMPOSER_ROOT=composer
TEST_DIRECTORY=tests/Application
INSTALL_DIRECTORY=install/Application
CONSOLE=cd ${TEST_DIRECTORY} && php bin/console -e test
COMPOSER=cd ${TEST_DIRECTORY} && composer
YARN=cd ${TEST_DIRECTORY} && yarn

SYLIUS_VERSION=2.0
SYMFONY_VERSION=7.2
PHP_VERSION=8.2
CONSOLE=vendor/bin/console
COMPOSER=composer
SYLIUS_VERSION=2.1.0
SYMFONY_VERSION=6.4
PLUGIN_NAME=synolia/sylius-scheduler-command-plugin

###
### DEVELOPMENT
### ¯¯¯¯¯¯¯¯¯¯¯

install: sylius ## Install Plugin on Sylius [SYLIUS_VERSION=2.0] [SYMFONY_VERSION=7.2] [PHP_VERSION=8.2]
install: sylius ## Install all dependencies with [SYLIUS_VERSION=2.1.0] [SYMFONY_VERSION=6.4]
.PHONY: install

reset: ## Remove dependencies
ifneq ("$(wildcard ${TEST_DIRECTORY}/bin/console)","")
${CONSOLE} doctrine:database:drop --force --if-exists || true
endif
rm -rf ${TEST_DIRECTORY}
rm -rf vendor
.PHONY: reset

phpunit: phpunit-configure phpunit-run ## Run PHPUnit
phpunit: ## Run PHPUnit tests
./vendor/bin/phpunit --testdox
.PHONY: phpunit

###
### OTHER
### ¯¯¯¯¯¯

sylius: sylius-standard update-dependencies install-plugin install-sylius
sylius: install-sylius
.PHONY: sylius

sylius-standard:
ifeq ($(shell [[ $(SYLIUS_VERSION) == *dev ]] && echo true ),true)
${COMPOSER_ROOT} create-project sylius/sylius-standard:${SYLIUS_VERSION} ${TEST_DIRECTORY} --no-install --no-scripts
else
${COMPOSER_ROOT} create-project sylius/sylius-standard ${TEST_DIRECTORY} "~${SYLIUS_VERSION}" --no-install --no-scripts
endif
${COMPOSER} config allow-plugins true
ifeq ($(shell [[ $(SYLIUS_VERSION) == *dev ]] && echo true ),true)
${COMPOSER} require --no-update sylius/sylius:"${SYLIUS_VERSION}"
else
${COMPOSER} require --no-update sylius/sylius:"~${SYLIUS_VERSION}"
endif

update-dependencies:
${COMPOSER} config extra.symfony.require "~${SYMFONY_VERSION}"
${COMPOSER} require symfony/asset:~${SYMFONY_VERSION} --no-scripts --no-update
${COMPOSER} update --no-progress -n

install-plugin:
${COMPOSER} config repositories.plugin '{"type": "path", "url": "../../"}'
${COMPOSER} config extra.symfony.allow-contrib true
${COMPOSER} config minimum-stability "dev"
${COMPOSER} config prefer-stable true
${COMPOSER} req ${PLUGIN_NAME}:* --prefer-source --no-scripts
cp -r ${INSTALL_DIRECTORY} tests

install-sylius:
${CONSOLE} doctrine:database:create -n --if-not-exists
${CONSOLE} doctrine:migrations:migrate -n
${CONSOLE} messenger:setup-transports -n
${CONSOLE} sylius:fixtures:load default -n
${YARN} install
${YARN} build
${CONSOLE} cache:clear

phpunit-configure:
cp phpunit.xml.dist ${TEST_DIRECTORY}/phpunit.xml

phpunit-run:
cd ${TEST_DIRECTORY} && ./vendor/bin/phpunit --testdox

behat-configure: ## Configure Behat
(cd ${TEST_DIRECTORY} && cp behat.yml.dist behat.yml)
(cd ${TEST_DIRECTORY} && sed -i "s#vendor/sylius/sylius/src/Sylius/Behat/Resources/config/suites.yml#vendor/${PLUGIN_NAME}/tests/Behat/Resources/suites.yml#g" behat.yml)
(cd ${TEST_DIRECTORY} && sed -i "s#vendor/sylius/sylius/features#vendor/${PLUGIN_NAME}/features#g" behat.yml)
(cd ${TEST_DIRECTORY} && sed -i "s#@cli#@javascript#g" behat.yml)
(cd ${TEST_DIRECTORY} && sed -i '2i \ \ \ \ - { resource: "../vendor/${PLUGIN_NAME}/tests/Behat/Resources/services.yml\" }' config/services_test.yaml)
${CONSOLE} cache:clear
@echo "Installing Sylius ${SYLIUS_VERSION} using TestApplication"
${COMPOSER} config extra.symfony.require "^${SYMFONY_VERSION}"
${COMPOSER} install
${COMPOSER} require --dev sylius/test-application:"^${SYLIUS_VERSION}@alpha" -n -W # TODO: Remove alpha when stable
${COMPOSER} test-application:install

grumphp: ## Run GrumPHP
vendor/bin/grumphp run
Expand Down
1 change: 1 addition & 0 deletions assets/admin/entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Mandatory by test application but useless
2 changes: 2 additions & 0 deletions assets/controllers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
1 change: 1 addition & 0 deletions assets/shop/entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Mandatory by test application but useless
66 changes: 0 additions & 66 deletions behat.yml.dist

This file was deleted.

Loading