Skip to content

Commit a482fe1

Browse files
Merge pull request #89 from webgriffe/sylius-2
Update to sylius 2.0
2 parents 7096d24 + 718b43f commit a482fe1

File tree

364 files changed

+2385
-3281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+2385
-3281
lines changed

.docker/nginx/nginx.conf

Lines changed: 0 additions & 48 deletions
This file was deleted.

.docker/php/php.ini

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 80 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php: ["8.1", "8.2", "8.3"]
25-
symfony: ["5.4.*", "^6.0"]
26-
sylius: ["1.12.16", "1.13.1"]
27-
node: ["18.x"]
28-
mysql: ["8.0"]
24+
php: ["8.4"]
25+
symfony: ["^7.3"]
26+
sylius: ["~2.2.0"]
27+
node: ["22.x"]
28+
mysql: ["8.4"]
2929

3030
env:
3131
APP_ENV: test
32+
BEHAT_BASE_URL: "https://127.0.0.1:8080/"
3233
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
3334

3435
steps:
3536
-
36-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
3738

3839
-
3940
name: Setup PHP
@@ -65,26 +66,14 @@ jobs:
6566
name: Output PHP version for Symfony CLI
6667
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
6768

68-
-
69-
name: Install certificates
70-
run: symfony server:ca:install
71-
72-
-
73-
name: Run Chrome Headless
74-
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 &
75-
76-
-
77-
name: Run webserver
78-
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
79-
8069
-
8170
name: Validate composer.json
8271
run: composer validate --ansi --strict
8372

8473
-
8574
name: Get Composer cache directory
8675
id: composer-cache
87-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
76+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8877

8978
-
9079
name: Cache Composer
@@ -95,16 +84,12 @@ jobs:
9584
restore-keys: |
9685
${{ runner.os }}-php-${{ matrix.php }}-composer-
9786
98-
-
99-
name: Configure global composer
100-
run: |
101-
composer global config --no-plugins allow-plugins.symfony/flex true
102-
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.2.2"
103-
10487
-
10588
name: Restrict Symfony version
10689
if: matrix.symfony != ''
10790
run: |
91+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.4"
92+
composer global config --no-plugins allow-plugins.symfony/flex true
10893
composer config extra.symfony.require "${{ matrix.symfony }}"
10994
11095
-
@@ -114,14 +99,36 @@ jobs:
11499

115100
-
116101
name: Install PHP dependencies
117-
run: composer install --no-interaction --no-plugins
118-
env:
119-
SYMFONY_REQUIRE: ${{ matrix.symfony }}
102+
run: composer install --no-interaction
103+
104+
-
105+
name: Validate container
106+
run: vendor/bin/console lint:container
107+
108+
-
109+
name: Run ECS
110+
run: vendor/bin/ecs check
111+
112+
-
113+
name: Run PHPStan
114+
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/
115+
116+
-
117+
name: Run Psalm
118+
run: vendor/bin/psalm
119+
120+
-
121+
name: Run PHPSpec
122+
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
123+
124+
-
125+
name: Run unit tests
126+
run: vendor/bin/phpunit --colors=always --testsuite=unit
120127

121128
-
122129
name: Get Yarn cache directory
123130
id: yarn-cache
124-
run: echo "::set-output name=dir::$(yarn cache dir)"
131+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
125132

126133
-
127134
name: Cache Yarn
@@ -134,73 +141,71 @@ jobs:
134141
135142
-
136143
name: Install JS dependencies
137-
run: (cd tests/Application && yarn install)
144+
run: (cd vendor/sylius/test-application && yarn install)
138145

139146
-
140147
name: Prepare test application database
141148
run: |
142-
(cd tests/Application && bin/console doctrine:database:create -vvv)
143-
(cd tests/Application && bin/console doctrine:schema:create -vvv)
149+
(vendor/bin/console doctrine:database:create -vvv)
150+
(vendor/bin/console doctrine:schema:create -vvv)
151+
152+
-
153+
name: Validate database schema
154+
run: vendor/bin/console doctrine:schema:validate
144155

145156
-
146157
name: Prepare test application assets
147158
run: |
148-
(cd tests/Application && bin/console assets:install public -vvv)
149-
(cd tests/Application && yarn build:prod)
159+
vendor/bin/console assets:install -vvv
160+
(cd vendor/sylius/test-application && yarn build)
150161
151162
-
152163
name: Prepare test application cache
153-
run: (cd tests/Application && bin/console cache:warmup -vvv)
164+
run: vendor/bin/console cache:warmup -vvv
154165

155166
-
156167
name: Load fixtures in test application
157-
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
158-
159-
-
160-
name: Validate database schema
161-
run: (cd tests/Application && bin/console doctrine:schema:validate)
162-
163-
-
164-
name: Run ECS
165-
run: vendor/bin/ecs check
166-
167-
-
168-
name: Run PHPStan
169-
run: vendor/bin/phpstan analyse
170-
171-
-
172-
name: Run Psalm
173-
run: vendor/bin/psalm
174-
175-
-
176-
name: Run PHPSpec
177-
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
178-
179-
-
180-
name: Run PHPUnit
181-
run: vendor/bin/phpunit --colors=always
182-
183-
#-
184-
# name: Run Behat
185-
# run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
186-
187-
-
188-
name: Upload Behat logs
189-
uses: actions/upload-artifact@v4
190-
if: failure()
191-
with:
192-
name: Behat logs
193-
path: etc/build/
194-
if-no-files-found: ignore
168+
run: vendor/bin/console sylius:fixtures:load -n
169+
170+
-
171+
name: Run Non-unit PHPUnit tests
172+
run: vendor/bin/phpunit --colors=always --testsuite=non-unit
173+
#
174+
# -
175+
# name: Install certificates
176+
# run: symfony server:ca:install || true
177+
#
178+
# -
179+
# name: Run Chrome Headless
180+
# 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 &
181+
#
182+
# -
183+
# name: Run webserver
184+
# run: symfony server:start --port=8080 --daemon
185+
#
186+
# -
187+
# name: Run Behat
188+
# run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
189+
#
190+
# -
191+
# name: Upload Behat logs
192+
# uses: actions/upload-artifact@v4
193+
# if: failure()
194+
# with:
195+
# name: "Behat logs - ${{ matrix.sylius }}-${{ github.run_id }}-${{ github.run_number }}"
196+
# path: etc/build/
197+
# if-no-files-found: ignore
198+
# compression-level: 6
199+
# overwrite: true
195200

196201
roave_bc_check:
197202
name: Roave BC Check
198203
runs-on: ubuntu-latest
199204
env:
200-
PHP_VERSION: 8.2
205+
PHP_VERSION: 8.4
201206
steps:
202207
- name: Checkout code
203-
uses: actions/checkout@v3
208+
uses: actions/checkout@v4
204209
with:
205210
fetch-depth: 0
206211

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
/vendor/
2+
/var/
23
/node_modules/
4+
/drivers/
35
/composer.lock
46

57
/etc/build/*
68
!/etc/build/.gitignore
79

8-
/tests/Application/yarn.lock
9-
1010
/.phpunit.result.cache
1111
/behat.yml
1212
/phpspec.yml
1313
/phpunit.xml
14+
/compose.override.yml
15+
/docker-compose.override.yml
16+
.phpunit.result.cache
1417

1518
# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project
1619
/.php-version
1720
/php.ini
18-
/docker-compose.override.yml
21+
22+
/tests/TestApplication/.env.local
23+
/tests/TestApplication/.env.*.local

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Webgriffe®
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)