From f9dca1490bacc784dbdde96b4424853818ff3d07 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Mon, 16 Jun 2025 13:30:37 +0200 Subject: [PATCH 1/3] Remove selenium --- behat.yml.dist | 24 ++---------------------- composer.json | 1 - 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/behat.yml.dist b/behat.yml.dist index dba95a8..05c89d2 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -15,34 +15,14 @@ default: files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/" base_url: "https://127.0.0.1:8080/" default_session: symfony - javascript_session: chrome_headless + javascript_session: chrome sessions: symfony: symfony: ~ - chrome_headless: + chrome: chrome: api_url: http://127.0.0.1:9222 validate_certificate: false - chrome: - selenium2: - browser: chrome - capabilities: - browserName: chrome - browser: chrome - version: "" - marionette: null # https://github.com/Behat/MinkExtension/pull/311 - chrome: - switches: - - "start-fullscreen" - - "start-maximized" - - "no-sandbox" - extra_capabilities: - unexpectedAlertBehaviour: accept - goog:chromeOptions: - w3c: false - firefox: - selenium2: - browser: firefox show_auto: false FriendsOfBehat\SymfonyExtension: diff --git a/composer.json b/composer.json index 5097be2..77d99a6 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,6 @@ }, "require-dev": { "behat/behat": "^3.14", - "behat/mink-selenium2-driver": "1.6", "bitbag/coding-standard": "^3.0.0", "dmore/behat-chrome-extension": "^1.4", "friends-of-behat/mink": "^1.11", From d7fb6e834143444995a9c983ef2f94597f9541a6 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Mon, 16 Jun 2025 13:58:10 +0200 Subject: [PATCH 2/3] Build fixes --- .github/workflows/build.yml | 19 +++++++------------ .github/{ => workflows}/coding_standard.yaml | 0 composer.json | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) rename .github/{ => workflows}/coding_standard.yaml (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bd12fc..a31596a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: matrix: php: [ "8.2", "8.3" ] symfony: [ "^7.1" ] - sylius: [ "~2.0.0" ] + sylius: [ "~2.0" ] node: [ "20.x" ] mysql: ["8.0"] @@ -113,7 +113,7 @@ jobs: - name: Cache Yarn - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} @@ -150,17 +150,12 @@ jobs: run: (cd tests/Application && bin/console doctrine:schema:validate) - - name: Run ECS - run: vendor/bin/ecs check src - - - - name: Run PHPStan - run: vendor/bin/phpstan analyse -c phpstan.neon -l 7 src/ + name: Run PHPUnit + run: vendor/bin/unit --colors=always - - name: Run PHPSpec - run: vendor/bin/phpspec run --ansi -f progress --no-interaction - + name: Run Create behat logs directory + run: (mkdir -p etc/build && chmod a+rw etc/build ) - name: Run Behat @@ -172,7 +167,7 @@ jobs: - name: Upload Behat logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: Behat logs diff --git a/.github/coding_standard.yaml b/.github/workflows/coding_standard.yaml similarity index 100% rename from .github/coding_standard.yaml rename to .github/workflows/coding_standard.yaml diff --git a/composer.json b/composer.json index 77d99a6..bf85e26 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "behat/behat": "^3.14", "bitbag/coding-standard": "^3.0.0", "dmore/behat-chrome-extension": "^1.4", + "dmore/chrome-mink-driver": "^2.9", "friends-of-behat/mink": "^1.11", "friends-of-behat/mink-browserkit-driver": "^1.6", "friends-of-behat/mink-debug-extension": "^2.1", @@ -37,7 +38,6 @@ "matthiasnoback/symfony-dependency-injection-test": "^5.1", "nelmio/alice": "^3.10", "nyholm/psr7": "^1.8", - "phpspec/phpspec": "^7.0", "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "robertfausk/behat-panther-extension": "^1.1", From 996d3d680a00ea35028514737b07272fe0e32bba Mon Sep 17 00:00:00 2001 From: Mateusz Date: Mon, 16 Jun 2025 15:15:11 +0200 Subject: [PATCH 3/3] Changes in .github/workflows --- .github/workflows/build.yml | 49 +++++++------ .github/workflows/coding_standard.yaml | 99 -------------------------- .github/workflows/coding_standard.yml | 81 +++++++++++++++++++++ 3 files changed, 110 insertions(+), 119 deletions(-) delete mode 100644 .github/workflows/coding_standard.yaml create mode 100644 .github/workflows/coding_standard.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a31596a..fbbe967 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,11 @@ jobs: fail-fast: false matrix: php: [ "8.2", "8.3" ] - symfony: [ "^7.1" ] + symfony: [ "^6.4", "^7.1" ] sylius: [ "~2.0" ] node: [ "20.x" ] - mysql: ["8.0"] + mysql: ["8.4"] + state_machine_adapter: ["symfony_workflow"] env: APP_ENV: test @@ -61,6 +62,14 @@ jobs: mysql version: "${{ matrix.mysql }}" mysql root password: "root" + - + name: Configure sysctl limits + run: | + sudo swapoff -a + sudo sysctl -w vm.swappiness=1 + sudo sysctl -w fs.file-max=262144 + sudo sysctl -w vm.max_map_count=262144 + - name: Output PHP version for Symfony CLI run: php -v | head -n 1 | awk '{ print $2 }' > .php-version @@ -90,6 +99,7 @@ jobs: key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} restore-keys: | ${{ runner.os }}-php-${{ matrix.php }}-composer- + - name: Restrict Symfony version if: matrix.symfony != '' @@ -97,6 +107,7 @@ jobs: composer global config --no-plugins allow-plugins.symfony/flex true composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10" composer config extra.symfony.require "${{ matrix.symfony }}" + - name: Restrict Sylius version if: matrix.sylius != '' @@ -104,7 +115,7 @@ jobs: - name: Install PHP dependencies - run: composer install --no-interaction + run: composer install --no-interaction --no-scripts - name: Get Yarn cache directory @@ -119,6 +130,7 @@ jobs: key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} restore-keys: | ${{ runner.os }}-node-${{ matrix.node }}-yarn- + - name: Install JS dependencies run: (cd tests/Application && yarn install) @@ -128,11 +140,13 @@ jobs: run: | (cd tests/Application && bin/console doctrine:database:create -vvv) (cd tests/Application && bin/console doctrine:schema:create -vvv) + - name: Prepare test application assets run: | - (cd tests/Application && bin/console assets:install public -vvv) (cd tests/Application && yarn encore dev) + (cd tests/Application && bin/console assets:install public -vvv) + - name: Prepare test application cache run: (cd tests/Application && bin/console cache:warmup -vvv) @@ -150,19 +164,14 @@ jobs: run: (cd tests/Application && bin/console doctrine:schema:validate) - - name: Run PHPUnit - run: vendor/bin/unit --colors=always - - - - name: Run Create behat logs directory + name: Create behat logs directory run: (mkdir -p etc/build && chmod a+rw etc/build ) + - + name: Run PHPUnit + run: vendor/bin/phpunit --colors=always - name: Run Behat - env: - MAIL_CHIMP_API_KEY: "mailchimp-api-key" - MAIL_CHIMP_LIST_ID: "mailchimp-list-id" - MAIL_CHIMP_WEBHOOK_SECRET: ${{ secrets.MAIL_CHIMP_WEBHOOK_SECRET }} run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun - @@ -179,10 +188,10 @@ jobs: uses: rtCamp/action-slack-notify@v2 if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} env: - SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }} - SLACK_COLOR: ${{ job.status }} - SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_MESSAGE: ':x:' - SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository - SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }} - SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }} + SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }} + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: https://github.com/rtCamp.png?size=48 + SLACK_MESSAGE: ':x:' + SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository + SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }} + SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }} diff --git a/.github/workflows/coding_standard.yaml b/.github/workflows/coding_standard.yaml deleted file mode 100644 index dd4c07a..0000000 --- a/.github/workflows/coding_standard.yaml +++ /dev/null @@ -1,99 +0,0 @@ -name: Coding standard - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: ~ - release: - types: [created] - schedule: - - - cron: "0 1 * * 6" # Run at 1am every Saturday - workflow_dispatch: ~ - -jobs: - tests: - runs-on: ubuntu-latest - - name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" - - strategy: - fail-fast: false - matrix: - php: [7.4, 7.3, 8.0] - symfony: [^4.4, ^5.2] - sylius: [~1.8.0, ~1.9.0, ~1.10.0] - node: [10.x] - mysql: [5.7] - - exclude: - - - php: 7.3 - mysql: 8.0 - - - sylius: ~1.8.0 - symfony: ^5.2 - - - sylius: ~1.8.0 - php: 8.0 - - - sylius: ~1.9.0 - php: 8.0 - - - sylius: ~1.10.0 - php: 7.3 - - env: - APP_ENV: test - DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" - - steps: - - - uses: actions/checkout@v2 - - - name: Get Composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - - name: Cache Composer - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php-${{ matrix.php }}-composer- - - - name: Restrict Symfony version - if: matrix.symfony != '' - run: | - composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10" - composer config extra.symfony.require "${{ matrix.symfony }}" - - - name: Restrict Sylius version - if: matrix.sylius != '' - run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction - - - - name: Install PHP dependencies - run: composer install --no-interaction - - - - name: Run PHPStan - run: vendor/bin/phpstan analyse -c phpstan.neon -l 7 src/ - - - name: Run ECS - run: vendor/bin/ecs - - - name: Failed build Slack notification - uses: rtCamp/action-slack-notify@v2 - if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} - env: - SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }} - SLACK_COLOR: ${{ job.status }} - SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_MESSAGE: ':x:' - SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository - SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }} - SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }} diff --git a/.github/workflows/coding_standard.yml b/.github/workflows/coding_standard.yml new file mode 100644 index 0000000..b629a1d --- /dev/null +++ b/.github/workflows/coding_standard.yml @@ -0,0 +1,81 @@ +name: Coding standard + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: ~ + release: + types: [ created ] + workflow_dispatch: ~ + +jobs: + tests: + runs-on: ubuntu-latest + + name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}" + + strategy: + fail-fast: false + matrix: + php: [ "8.2", "8.3" ] + symfony: [ "^6.4", "^7.1" ] + sylius: [ "~2.0.0" ] + node: [ "20.x" ] + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + extensions: intl + tools: symfony + coverage: none + + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache Composer + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json', '**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}-composer- + + - name: Restrict Symfony version + if: matrix.symfony != '' + run: | + composer global config --no-plugins allow-plugins.symfony/flex true + composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10" + composer config extra.symfony.require "${{ matrix.symfony }}" + + - name: Restrict Sylius version + if: matrix.sylius != '' + run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction + + - name: Install PHP dependencies + run: composer install --no-interaction + env: + SYMFONY_REQUIRE: ${{ matrix.symfony }} + + - name: Run PHPStan + run: vendor/bin/phpstan analyse -c phpstan.neon -l 8 src + + - name: Run ECS + run: vendor/bin/ecs check src + + - name: Failed build Slack notification + uses: rtCamp/action-slack-notify@v2 + if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} + env: + SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }} + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: https://github.com/rtCamp.png?size=48 + SLACK_MESSAGE: ':x:' + SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository + SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }} + SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}