Skip to content

Commit 05b89cb

Browse files
authored
Merge pull request #75 from BitBagCommerce/feature/OP-573-remove-selenium2-from-behat
OP-573 - Remove selenium2 driver
2 parents bb388b9 + ca603fe commit 05b89cb

File tree

6 files changed

+94
-140
lines changed

6 files changed

+94
-140
lines changed

.github/coding_standard.yaml

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

.github/workflows/build.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
matrix:
2424
php: [ "8.2", "8.3" ]
2525
symfony: [ "^7.1" ]
26-
sylius: [ "~2.0.0" ]
26+
sylius: [ "^2.0" ]
2727
node: [ "20.x" ]
2828
mysql: ["8.0"]
2929

@@ -113,7 +113,7 @@ jobs:
113113

114114
-
115115
name: Cache Yarn
116-
uses: actions/cache@v2
116+
uses: actions/cache@v4
117117
with:
118118
path: ${{ steps.yarn-cache.outputs.dir }}
119119
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
@@ -150,17 +150,12 @@ jobs:
150150
run: (cd tests/Application && bin/console doctrine:schema:validate)
151151

152152
-
153-
name: Run ECS
154-
run: vendor/bin/ecs check src
155-
156-
-
157-
name: Run PHPStan
158-
run: vendor/bin/phpstan analyse -c phpstan.neon -l 7 src/
153+
name: Run PHPUnit
154+
run: vendor/bin/phpunit --colors=always
159155

160156
-
161-
name: Run PHPSpec
162-
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
163-
157+
name: Create behat logs directory
158+
run: (mkdir -p etc/build && chmod a+rw etc/build )
164159

165160
-
166161
name: Run Behat
@@ -172,7 +167,7 @@ jobs:
172167

173168
-
174169
name: Upload Behat logs
175-
uses: actions/upload-artifact@v3
170+
uses: actions/upload-artifact@v4
176171
if: failure()
177172
with:
178173
name: Behat logs
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Coding standard
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request: ~
8+
release:
9+
types: [created]
10+
schedule:
11+
-
12+
cron: "0 1 * * 6" # Run at 1am every Saturday
13+
workflow_dispatch: ~
14+
15+
jobs:
16+
tests:
17+
runs-on: ubuntu-latest
18+
19+
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}"
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
php: [ "8.2", "8.3" ]
25+
symfony: [ "^7.1" ]
26+
sylius: [ "^2.0" ]
27+
node: [ "20.x" ]
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: "${{ matrix.php }}"
36+
extensions: intl
37+
tools: symfony
38+
coverage: none
39+
40+
- name: Get Composer cache directory
41+
id: composer-cache
42+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
43+
44+
- name: Cache Composer
45+
uses: actions/cache@v4
46+
with:
47+
path: ${{ steps.composer-cache.outputs.dir }}
48+
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json', '**/composer.lock') }}
49+
restore-keys: |
50+
${{ runner.os }}-php-${{ matrix.php }}-composer-
51+
52+
- name: Restrict Symfony version
53+
if: matrix.symfony != ''
54+
run: |
55+
composer global config --no-plugins allow-plugins.symfony/flex true
56+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
57+
composer config extra.symfony.require "${{ matrix.symfony }}"
58+
59+
- name: Restrict Sylius version
60+
if: matrix.sylius != ''
61+
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
62+
63+
- name: Install PHP dependencies
64+
run: composer install --no-interaction
65+
env:
66+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
67+
68+
- name: Run PHPStan
69+
run: vendor/bin/phpstan analyse -c phpstan.neon -l 8 src/
70+
71+
- name: Run ECS
72+
run: vendor/bin/ecs check src
73+
74+
- name: Failed build Slack notification
75+
uses: rtCamp/action-slack-notify@v2
76+
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
77+
env:
78+
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
79+
SLACK_COLOR: ${{ job.status }}
80+
SLACK_ICON: https://github.com/rtCamp.png?size=48
81+
SLACK_MESSAGE: ':x:'
82+
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
83+
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
84+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}

behat.yml.dist

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +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-
goog:chromeOptions:
42-
w3c: false
43-
firefox:
44-
selenium2:
45-
browser: firefox
4626
show_auto: false
4727

4828
FriendsOfBehat\SymfonyExtension:

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
},
2121
"require-dev": {
2222
"behat/behat": "^3.14",
23-
"behat/mink-selenium2-driver": "1.6",
2423
"bitbag/coding-standard": "^3.0.0",
2524
"dmore/behat-chrome-extension": "^1.4",
25+
"dmore/chrome-mink-driver": "^2.9",
2626
"friends-of-behat/mink": "^1.11",
2727
"friends-of-behat/mink-browserkit-driver": "^1.6",
2828
"friends-of-behat/mink-debug-extension": "^2.1",
@@ -38,7 +38,6 @@
3838
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
3939
"nelmio/alice": "^3.10",
4040
"nyholm/psr7": "^1.8",
41-
"phpspec/phpspec": "^7.0",
4241
"phpunit/phpunit": "^9.5",
4342
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
4443
"robertfausk/behat-panther-extension": "^1.1",

phpspec.yml

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

0 commit comments

Comments
 (0)