Skip to content

Commit 4836444

Browse files
authored
Merge pull request #20 from BitBagCommerce/feature/remove-selenium2
OP-573 Remove selenium2
2 parents 7fe8f40 + 0857021 commit 4836444

File tree

4 files changed

+115
-97
lines changed

4 files changed

+115
-97
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
release:
99
types: [created]
1010
schedule:
11-
- cron: "0 1 * * 6" # Run at 1am every Saturday
11+
-
12+
cron: "0 1 * * 6" # Run at 1am every Saturday
1213
workflow_dispatch: ~
1314

1415
jobs:
@@ -22,9 +23,10 @@ jobs:
2223
matrix:
2324
php: [ "8.2", "8.3" ]
2425
symfony: [ "^6.4", "^7.1" ]
25-
sylius: [ "^2.0.4" ]
26-
node: [ "20.x", "22.x" ]
27-
mysql: [ "5.7", "8.0" ]
26+
sylius: [ "~2.0" ]
27+
node: [ "20.x" ]
28+
mysql: ["8.4"]
29+
state_machine_adapter: ["symfony_workflow"]
2830

2931
env:
3032
APP_ENV: test
@@ -60,6 +62,14 @@ jobs:
6062
mysql version: "${{ matrix.mysql }}"
6163
mysql root password: "root"
6264

65+
-
66+
name: Configure sysctl limits
67+
run: |
68+
sudo swapoff -a
69+
sudo sysctl -w vm.swappiness=1
70+
sudo sysctl -w fs.file-max=262144
71+
sudo sysctl -w vm.max_map_count=262144
72+
6373
-
6474
name: Output PHP version for Symfony CLI
6575
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
@@ -68,6 +78,14 @@ jobs:
6878
name: Install certificates
6979
run: symfony server:ca:install
7080

81+
-
82+
name: Run Chrome Headless
83+
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 &
84+
85+
-
86+
name: Run webserver
87+
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
88+
7189
-
7290
name: Get Composer cache directory
7391
id: composer-cache
@@ -81,28 +99,28 @@ jobs:
8199
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
82100
restore-keys: |
83101
${{ runner.os }}-php-${{ matrix.php }}-composer-
102+
84103
-
85104
name: Restrict Symfony version
86105
if: matrix.symfony != ''
87106
run: |
88107
composer global config --no-plugins allow-plugins.symfony/flex true
89108
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
90109
composer config extra.symfony.require "${{ matrix.symfony }}"
110+
91111
-
92112
name: Restrict Sylius version
93113
if: matrix.sylius != ''
94114
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
95115

96116
-
97117
name: Install PHP dependencies
98-
run: composer install --no-interaction
99-
env:
100-
SYMFONY_REQUIRE: ${{ matrix.symfony }}
118+
run: composer install --no-interaction --no-scripts
101119

102120
-
103121
name: Get Yarn cache directory
104122
id: yarn-cache
105-
run: echo "::set-output name=dir::$(yarn cache dir)"
123+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
106124

107125
-
108126
name: Cache Yarn
@@ -112,6 +130,7 @@ jobs:
112130
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
113131
restore-keys: |
114132
${{ runner.os }}-node-${{ matrix.node }}-yarn-
133+
115134
-
116135
name: Install JS dependencies
117136
run: (cd tests/Application && yarn install)
@@ -121,11 +140,13 @@ jobs:
121140
run: |
122141
(cd tests/Application && bin/console doctrine:database:create -vvv)
123142
(cd tests/Application && bin/console doctrine:schema:create -vvv)
143+
124144
-
125145
name: Prepare test application assets
126146
run: |
127-
(cd tests/Application && bin/console assets:install public -vvv)
128147
(cd tests/Application && yarn encore dev)
148+
(cd tests/Application && bin/console assets:install public -vvv)
149+
129150
-
130151
name: Prepare test application cache
131152
run: (cd tests/Application && bin/console cache:warmup -vvv)
@@ -142,10 +163,26 @@ jobs:
142163
name: Validate database schema
143164
run: (cd tests/Application && bin/console doctrine:schema:validate)
144165

166+
-
167+
name: Create behat logs directory
168+
run: (mkdir -p etc/build && chmod a+rw etc/build )
145169
-
146170
name: Run PHPUnit
147171
run: vendor/bin/phpunit --colors=always
148172

173+
-
174+
name: Run Behat
175+
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
176+
177+
-
178+
name: Upload Behat logs
179+
uses: actions/upload-artifact@v4
180+
if: failure()
181+
with:
182+
name: Behat logs
183+
path: etc/build/
184+
if-no-files-found: ignore
185+
149186
-
150187
name: Failed build Slack notification
151188
uses: rtCamp/action-slack-notify@v2
Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
11
name: Coding standard
22

33
on:
4-
push:
5-
branches-ignore:
6-
- 'dependabot/**'
7-
pull_request: ~
8-
release:
9-
types: [ created ]
10-
workflow_dispatch: ~
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request: ~
8+
release:
9+
types: [ created ]
10+
workflow_dispatch: ~
1111

1212
jobs:
13-
tests:
14-
runs-on: ubuntu-latest
15-
16-
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}"
17-
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
php: [ "8.2", "8.3" ]
22-
symfony: [ "^6.4", "^7.1" ]
23-
sylius: [ "^2.0.4" ]
24-
node: [ "20.x", "22.x" ]
25-
26-
steps:
27-
- uses: actions/checkout@v3
13+
tests:
14+
runs-on: ubuntu-latest
2815

29-
- name: Setup PHP
30-
uses: shivammathur/setup-php@v2
31-
with:
32-
php-version: "${{ matrix.php }}"
33-
extensions: intl
34-
tools: symfony
35-
coverage: none
16+
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}"
3617

37-
- name: Get Composer cache directory
38-
id: composer-cache
39-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php: [ "8.2", "8.3" ]
22+
symfony: [ "^6.4", "^7.1" ]
23+
sylius: [ "~2.0.0" ]
24+
node: [ "20.x" ]
4025

41-
- name: Cache Composer
42-
uses: actions/cache@v4
43-
with:
44-
path: ${{ steps.composer-cache.outputs.dir }}
45-
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json', '**/composer.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-php-${{ matrix.php }}-composer-
26+
steps:
27+
- uses: actions/checkout@v3
4828

49-
- name: Restrict Symfony version
50-
if: matrix.symfony != ''
51-
run: |
52-
composer global config --no-plugins allow-plugins.symfony/flex true
53-
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
54-
composer config extra.symfony.require "${{ matrix.symfony }}"
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: "${{ matrix.php }}"
33+
extensions: intl
34+
tools: symfony
35+
coverage: none
5536

56-
- name: Restrict Sylius version
57-
if: matrix.sylius != ''
58-
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
37+
- name: Get Composer cache directory
38+
id: composer-cache
39+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
5940

60-
- name: Install PHP dependencies
61-
run: composer install --no-interaction
62-
env:
63-
SYMFONY_REQUIRE: ${{ matrix.symfony }}
41+
- name: Cache Composer
42+
uses: actions/cache@v4
43+
with:
44+
path: ${{ steps.composer-cache.outputs.dir }}
45+
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json', '**/composer.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-php-${{ matrix.php }}-composer-
6448
65-
- name: Run PHPStan
66-
run: vendor/bin/phpstan analyse -c phpstan.neon -l 7 src/
49+
- name: Restrict Symfony version
50+
if: matrix.symfony != ''
51+
run: |
52+
composer global config --no-plugins allow-plugins.symfony/flex true
53+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
54+
composer config extra.symfony.require "${{ matrix.symfony }}"
6755
68-
- name: Run ECS
69-
run: vendor/bin/ecs check src --debug
56+
- name: Restrict Sylius version
57+
if: matrix.sylius != ''
58+
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
7059

71-
- name: Failed build Slack notification
72-
uses: rtCamp/action-slack-notify@v2
73-
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
74-
env:
75-
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
76-
SLACK_COLOR: ${{ job.status }}
77-
SLACK_ICON: https://github.com/rtCamp.png?size=48
78-
SLACK_MESSAGE: ':x:'
79-
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
80-
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
81-
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
60+
- name: Install PHP dependencies
61+
run: composer install --no-interaction
62+
env:
63+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
64+
65+
- name: Run PHPStan
66+
run: vendor/bin/phpstan analyse -c phpstan.neon -l 8 src
67+
68+
- name: Run ECS
69+
run: vendor/bin/ecs check src
70+
71+
- name: Failed build Slack notification
72+
uses: rtCamp/action-slack-notify@v2
73+
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
74+
env:
75+
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
76+
SLACK_COLOR: ${{ job.status }}
77+
SLACK_ICON: https://github.com/rtCamp.png?size=48
78+
SLACK_MESSAGE: ':x:'
79+
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
80+
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
81+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}

behat.yml.dist

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,14 @@ default:
1515
files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"
1616
base_url: "https://127.0.0.1:8080/"
1717
default_session: symfony
18-
javascript_session: chrome_headless
18+
javascript_session: chrome
1919
sessions:
2020
symfony:
2121
symfony: ~
22-
chrome_headless:
22+
chrome:
2323
chrome:
2424
api_url: http://127.0.0.1:9222
2525
validate_certificate: false
26-
chrome:
27-
selenium2:
28-
browser: chrome
29-
capabilities:
30-
browserName: chrome
31-
browser: chrome
32-
version: ""
33-
marionette: null # https://github.com/Behat/MinkExtension/pull/311
34-
chrome:
35-
switches:
36-
- "start-fullscreen"
37-
- "start-maximized"
38-
- "no-sandbox"
39-
extra_capabilities:
40-
unexpectedAlertBehaviour: accept
41-
firefox:
42-
selenium2:
43-
browser: firefox
4426
show_auto: false
4527

4628
FriendsOfBehat\SymfonyExtension:

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
},
1414
"require-dev": {
1515
"behat/behat": "^3.14",
16-
"behat/mink-selenium2-driver": "^1.6",
1716
"bitbag/coding-standard": "^3.0",
1817
"dmore/behat-chrome-extension": "^1.4",
1918
"dmore/chrome-mink-driver": "^2.9",

0 commit comments

Comments
 (0)