Skip to content

Commit 025c757

Browse files
authored
Merge pull request #68 from tomkalon/feature/OP-367
Feature/op 367 - Sylius 1.13 support
2 parents 8b4b7cb + 35c38b4 commit 025c757

22 files changed

+316
-379
lines changed

.github/workflows/build.yml

+156-159
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,161 @@
11
name: Build
22

33
on:
4-
push:
5-
branches-ignore:
6-
- 'dependabot/**'
7-
pull_request: ~
8-
release:
9-
types: [ created ]
10-
schedule:
11-
- cron: "0 1 * * 6" # Run at 1am every Saturday
12-
workflow_dispatch: ~
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request: ~
8+
release:
9+
types: [ created ]
10+
schedule:
11+
- cron: "0 1 * * 6" # Run at 1am every Saturday
12+
workflow_dispatch: ~
1313

1414
jobs:
15-
tests:
16-
runs-on: ubuntu-22.04
17-
18-
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"
19-
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
php: [ "8.0" ]
24-
symfony: [ "^5.4", "^6.0" ]
25-
sylius: [ "~1.11.0", "~1.12.0" ]
26-
node: [ "^14.17.x" ]
27-
mysql: [ "5.7", "8.0" ]
28-
29-
exclude:
30-
- sylius: ~1.11.0
31-
symfony: "^6.0"
32-
env:
33-
APP_ENV: test
34-
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
35-
36-
steps:
37-
- uses: actions/checkout@v2
38-
39-
- name: Setup PHP
40-
uses: shivammathur/setup-php@v2
41-
with:
42-
php-version: "${{ matrix.php }}"
43-
extensions: intl
44-
tools: symfony
45-
coverage: none
46-
47-
- name: Setup Node
48-
uses: actions/setup-node@v1
49-
with:
50-
node-version: "${{ matrix.node }}"
51-
52-
- name: Shutdown default MySQL
53-
run: sudo service mysql stop
54-
55-
- name: Setup MySQL
56-
uses: mirromutth/mysql-action@v1.1
57-
with:
58-
mysql version: "${{ matrix.mysql }}"
59-
mysql root password: "root"
60-
61-
- name: Configure sysctl limits
62-
run: |
63-
sudo swapoff -a
64-
sudo sysctl -w vm.swappiness=1
65-
sudo sysctl -w fs.file-max=262144
66-
sudo sysctl -w vm.max_map_count=262144
67-
68-
- name: Runs Elasticsearch
69-
uses: elastic/elastic-github-actions/elasticsearch@master
70-
with:
71-
stack-version: 7.16.3
72-
73-
- name: Output PHP version for Symfony CLI
74-
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
75-
76-
- name: Install certificates
77-
run: symfony server:ca:install
78-
79-
- name: Run Chrome Headless
80-
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 &
81-
82-
- name: Run webserver
83-
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
84-
85-
- name: Get Composer cache directory
86-
id: composer-cache
87-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
88-
89-
- name: Cache Composer
90-
uses: actions/cache@v2
91-
with:
92-
path: ${{ steps.composer-cache.outputs.dir }}
93-
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
94-
restore-keys: |
95-
${{ runner.os }}-php-${{ matrix.php }}-composer-
96-
97-
- name: Restrict Symfony version
98-
if: matrix.symfony != ''
99-
run: |
100-
composer global config --no-plugins allow-plugins.symfony/flex true
101-
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
102-
composer config extra.symfony.require "${{ matrix.symfony }}"
103-
104-
- name: Restrict Sylius version
105-
if: matrix.sylius != ''
106-
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
107-
108-
- name: Install PHP dependencies
109-
run: composer install --no-interaction --no-scripts
110-
111-
- name: Get Yarn cache directory
112-
id: yarn-cache
113-
run: echo "::set-output name=dir::$(yarn cache dir)"
114-
115-
- name: Cache Yarn
116-
uses: actions/cache@v2
117-
with:
118-
path: ${{ steps.yarn-cache.outputs.dir }}
119-
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
120-
restore-keys: |
121-
${{ runner.os }}-node-${{ matrix.node }}-yarn-
122-
123-
- name: Install JS dependencies
124-
run: (cd tests/Application && yarn install)
125-
126-
- name: Prepare test application database
127-
run: |
128-
(cd tests/Application && bin/console doctrine:database:create -vvv)
129-
(cd tests/Application && bin/console doctrine:schema:create -vvv)
130-
131-
- name: Prepare test application assets
132-
run: |
133-
(cd tests/Application && bin/console assets:install public -vvv)
134-
(cd tests/Application && yarn encore dev)
135-
136-
- name: Prepare test application cache
137-
run: (cd tests/Application && bin/console cache:warmup -vvv)
138-
139-
- name: Load fixtures in test application
140-
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
141-
142-
- name: Validate composer.json
143-
run: composer validate --ansi --strict
144-
145-
- name: Validate database schema
146-
run: (cd tests/Application && bin/console doctrine:schema:validate)
147-
148-
- name: Run PHPSpec
149-
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
150-
151-
- name: Run Behat
152-
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
153-
154-
- name: Failed build Slack notification
155-
uses: rtCamp/action-slack-notify@v2
156-
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
157-
env:
158-
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
159-
SLACK_COLOR: ${{ job.status }}
160-
SLACK_ICON: https://github.com/rtCamp.png?size=48
161-
SLACK_MESSAGE: ':x:'
162-
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
163-
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
164-
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
15+
tests:
16+
runs-on: ubuntu-22.04
17+
18+
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
php: [ "8.0", "8.1", "8.2", "8.3" ]
24+
symfony: [ "^5.4", "^6.0" ]
25+
sylius: [ "~1.12.0", "~1.13.0" ]
26+
node: [ "^14.17.x" ]
27+
mysql: [ "5.7", "8.0" ]
28+
29+
env:
30+
APP_ENV: test
31+
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
36+
- name: Setup PHP
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: "${{ matrix.php }}"
40+
extensions: intl
41+
tools: symfony
42+
coverage: none
43+
44+
- name: Setup Node
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: "${{ matrix.node }}"
48+
49+
- name: Shutdown default MySQL
50+
run: sudo service mysql stop
51+
52+
- name: Setup MySQL
53+
uses: mirromutth/mysql-action@v1.1
54+
with:
55+
mysql version: "${{ matrix.mysql }}"
56+
mysql root password: "root"
57+
58+
- name: Configure sysctl limits
59+
run: |
60+
sudo swapoff -a
61+
sudo sysctl -w vm.swappiness=1
62+
sudo sysctl -w fs.file-max=262144
63+
sudo sysctl -w vm.max_map_count=262144
64+
65+
- name: Runs Elasticsearch
66+
uses: elastic/elastic-github-actions/elasticsearch@master
67+
with:
68+
stack-version: 7.16.3
69+
70+
- name: Output PHP version for Symfony CLI
71+
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
72+
73+
- name: Install certificates
74+
run: symfony server:ca:install
75+
76+
- name: Run Chrome Headless
77+
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 &
78+
79+
- name: Run webserver
80+
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
81+
82+
- name: Get Composer cache directory
83+
id: composer-cache
84+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
85+
86+
- name: Cache Composer
87+
uses: actions/cache@v2
88+
with:
89+
path: ${{ steps.composer-cache.outputs.dir }}
90+
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
91+
restore-keys: |
92+
${{ runner.os }}-php-${{ matrix.php }}-composer-
93+
94+
- name: Restrict Symfony version
95+
if: matrix.symfony != ''
96+
run: |
97+
composer global config --no-plugins allow-plugins.symfony/flex true
98+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
99+
composer config extra.symfony.require "${{ matrix.symfony }}"
100+
101+
- name: Restrict Sylius version
102+
if: matrix.sylius != ''
103+
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
104+
105+
- name: Install PHP dependencies
106+
run: composer install --no-interaction --no-scripts
107+
108+
- name: Get Yarn cache directory
109+
id: yarn-cache
110+
run: echo "::set-output name=dir::$(yarn cache dir)"
111+
112+
- name: Cache Yarn
113+
uses: actions/cache@v2
114+
with:
115+
path: ${{ steps.yarn-cache.outputs.dir }}
116+
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
117+
restore-keys: |
118+
${{ runner.os }}-node-${{ matrix.node }}-yarn-
119+
120+
- name: Install JS dependencies
121+
run: (cd tests/Application && yarn install)
122+
123+
- name: Prepare test application database
124+
run: |
125+
(cd tests/Application && bin/console doctrine:database:create -vvv)
126+
(cd tests/Application && bin/console doctrine:schema:create -vvv)
127+
128+
- name: Prepare test application assets
129+
run: |
130+
(cd tests/Application && bin/console assets:install public -vvv)
131+
(cd tests/Application && yarn encore dev)
132+
133+
- name: Prepare test application cache
134+
run: (cd tests/Application && bin/console cache:warmup -vvv)
135+
136+
- name: Load fixtures in test application
137+
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
138+
139+
- name: Validate composer.json
140+
run: composer validate --ansi --strict
141+
142+
- name: Validate database schema
143+
run: (cd tests/Application && bin/console doctrine:schema:validate)
144+
145+
- name: Run PHPSpec
146+
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
147+
148+
- name: Run Behat
149+
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
150+
151+
- name: Failed build Slack notification
152+
uses: rtCamp/action-slack-notify@v2
153+
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
154+
env:
155+
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
156+
SLACK_COLOR: ${{ job.status }}
157+
SLACK_ICON: https://github.com/rtCamp.png?size=48
158+
SLACK_MESSAGE: ':x:'
159+
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
160+
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
161+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/vendor
2+
/node_modules/
3+
/composer.lock
24

35
!tests/Application/web/app_test.php
46
tests/Application/web/*

composer.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
],
1616
"require": {
1717
"php": "^8.0",
18-
"sylius/sylius": "~1.11.0 || ~1.12.0",
18+
"sylius/sylius": "~1.12.0 || ~1.13.0",
1919
"openpayu/openpayu": "^2.2",
2020
"php-http/message-factory": "^1.1"
2121
},
2222
"require-dev": {
2323
"symfony/webpack-encore-bundle": "^1.15",
2424
"behat/behat": "^3.7",
25-
"behat/mink-selenium2-driver": "^1.4",
25+
"behat/mink-selenium2-driver": "~1.6.0",
2626
"dmore/behat-chrome-extension": "^1.3",
2727
"dmore/chrome-mink-driver": "^2.7",
2828
"friends-of-behat/mink": "^1.8",
@@ -42,16 +42,11 @@
4242
"symfony/intl": "^5.4 || ^6.0",
4343
"symfony/web-profiler-bundle": "^6.0 || ^5.4",
4444
"vimeo/psalm": "4.16.1",
45-
"symfony/dependency-injection": "<4.4.19 || ^5.2",
4645
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
4746
"bitbag/coding-standard": "^3.0"
4847
},
4948
"conflict": {
50-
"symfony/symfony": "4.1.8",
51-
"symfony/browser-kit": "4.1.8",
52-
"symfony/dom-crawler": "4.1.8",
53-
"symfony/routing": "4.1.8",
54-
"symfony/doctrine-bridge": "4.4.16"
49+
"doctrine/persistence": "<3.0"
5550
},
5651
"prefer-stable": true,
5752
"autoload": {

src/Exception/PayUResponseException.php

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
namespace BitBag\SyliusPayUPlugin\Exception;
1212

1313
use Exception;
14-
use Payum\Core\Exception\Http\HttpException;
15-
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
1614

1715
final class PayUResponseException extends Exception
1816
{

tests/Application/config/sylius/1.11/packages/dev/jms_serializer.yaml

-12
This file was deleted.

tests/Application/config/sylius/1.11/packages/dev/swiftmailer.yaml

-2
This file was deleted.

tests/Application/config/sylius/1.11/packages/jms_serializer.yaml

-4
This file was deleted.

0 commit comments

Comments
 (0)