Build #579
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| paths-ignore: | |
| - "*.md" | |
| pull_request: | |
| paths-ignore: | |
| - "*.md" | |
| release: | |
| types: [created] | |
| schedule: | |
| - | |
| cron: "0 1 * * *" # Run at 1am every day | |
| workflow_dispatch: ~ | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, ${{ matrix.database == 'mysql' && format('MySQL {0}', matrix.database_version) || matrix.database == 'postgres' && format('PostgreSQL {0}', matrix.database_version) }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}, legacy_pdf_generation: ${{ matrix.legacy_pdf_generation }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ["8.2", "8.3"] | |
| symfony: ["^6.4", "^7.4"] | |
| sylius: ["~2.0.0", "~2.1.0", "~2.2.0"] | |
| node: ["22.x"] | |
| database: ["mysql"] | |
| database_version: ["8.4"] | |
| wkhtmltopdf: ["0.12.6.1-2"] | |
| state_machine_adapter: ["symfony_workflow"] | |
| legacy_pdf_generation: [true, false] | |
| include: | |
| - | |
| php: "8.3" | |
| symfony: "^7.4" | |
| sylius: "~2.2.0" | |
| node: "24.x" | |
| database: "mysql" | |
| database_version: "8.4" | |
| wkhtmltopdf: "0.12.6.1-2" | |
| state_machine_adapter: "winzou_state_machine" | |
| legacy_pdf_generation: true | |
| - | |
| php: "8.3" | |
| symfony: "^7.4" | |
| sylius: "~2.2.0" | |
| node: "24.x" | |
| database: "mysql" | |
| database_version: "8.4" | |
| wkhtmltopdf: "0.12.6.1-2" | |
| state_machine_adapter: "winzou_state_machine" | |
| legacy_pdf_generation: false | |
| - | |
| php: "8.3" | |
| symfony: "^7.4" | |
| sylius: "~2.2.0" | |
| node: "24.x" | |
| database: "mysql" | |
| database_version: "8.4" | |
| wkhtmltopdf: false | |
| state_machine_adapter: "symfony_workflow" | |
| legacy_pdf_generation: true | |
| - | |
| php: "8.3" | |
| symfony: "^7.4" | |
| sylius: "~2.2.0" | |
| node: "24.x" | |
| database: "mysql" | |
| database_version: "8.4" | |
| wkhtmltopdf: false | |
| state_machine_adapter: "symfony_workflow" | |
| legacy_pdf_generation: false | |
| - | |
| php: "8.3" | |
| symfony: "^7.4" | |
| sylius: "~2.2.0" | |
| node: "24.x" | |
| database: "postgres" | |
| database_version: "15.8" | |
| wkhtmltopdf: "0.12.6.1-2" | |
| state_machine_adapter: "symfony_workflow" | |
| legacy_pdf_generation: true | |
| - | |
| php: "8.3" | |
| symfony: "^7.4" | |
| sylius: "~2.2.0" | |
| node: "24.x" | |
| database: "postgres" | |
| database_version: "15.8" | |
| wkhtmltopdf: "0.12.6.1-2" | |
| state_machine_adapter: "symfony_workflow" | |
| legacy_pdf_generation: false | |
| env: | |
| APP_ENV: test | |
| DATABASE_URL: ${{ matrix.database == 'mysql' && format('mysql://root:root@127.0.0.1/sylius?serverVersion={0}', matrix.database_version) || format('pgsql://postgres:postgres@127.0.0.1/sylius?serverVersion={0}', matrix.database_version) }} | |
| TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}" | |
| TEST_SYLIUS_REFUND_PDF_GENERATION_DISABLED: ${{ matrix.wkhtmltopdf == false }} | |
| TEST_SYLIUS_REFUND_PDF_LEGACY: "${{ matrix.legacy_pdf_generation }}" | |
| steps: | |
| - | |
| uses: actions/checkout@v4 | |
| - | |
| name: Setup cache for wkhtmltopdf | |
| uses: actions/cache@v4 | |
| id: cache-wkhtmltopdf | |
| if: matrix.wkhtmltopdf != false | |
| with: | |
| path: /usr/local/bin/wkhtmltopdf | |
| key: wkhtmltopdf-${{ matrix.wkhtmltopdf }} | |
| - | |
| name: Install wkthtmltopdf | |
| if: matrix.wkhtmltopdf != false && steps.cache-wkhtmltopdf.outputs.cache-hit != 'true' | |
| run: | | |
| sudo apt-get install -y xfonts-base xfonts-75dpi | |
| wget https://github.com/wkhtmltopdf/packaging/releases/download/${{ matrix.wkhtmltopdf }}/wkhtmltox_${{ matrix.wkhtmltopdf }}.jammy_amd64.deb | |
| sudo dpkg -i wkhtmltox_${{ matrix.wkhtmltopdf }}.jammy_amd64.deb | |
| - | |
| name: Output PHP version for Symfony CLI | |
| run: php -v | head -n 1 | awk '{ print $2 }' > .php-version | |
| - | |
| 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: Require Winzou State Machine | |
| if: "${{ matrix.state_machine_adapter == 'winzou_state_machine' }}" | |
| run: | | |
| composer require winzou/state-machine:^0.4 --no-update | |
| composer require winzou/state-machine-bundle:^0.6 --no-update | |
| - | |
| name: Build Sylius Test Application | |
| uses: SyliusLabs/BuildTestAppAction@v3.2.0 | |
| with: | |
| e2e_js: "yes" | |
| cache_key: "${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}" | |
| cache_restore_key: "${{ runner.os }}-php-${{ matrix.php }}-composer-" | |
| database: "${{ matrix.database }}" | |
| database_version: "${{ matrix.database_version }}" | |
| node_version: "${{ matrix.node }}" | |
| php_version: "${{ matrix.php }}" | |
| sylius_version: "${{ matrix.sylius }}" | |
| symfony_version: "${{ matrix.symfony }}" | |
| - | |
| name: Run security check | |
| run: composer audit --abandoned=ignore | |
| - | |
| name: Validate composer.json | |
| run: composer validate --ansi --strict | |
| - | |
| name: Run ECS | |
| run: vendor/bin/ecs check src/ | |
| - | |
| name: Lint container | |
| run: vendor/bin/console lint:container | |
| - | |
| name: Run PHPStan | |
| run: vendor/bin/phpstan analyse -c phpstan.neon src/ | |
| - | |
| name: Run PHPUnit | |
| run: vendor/bin/phpunit --colors=always | |
| - | |
| name: Run Behat | |
| run: | | |
| if [ "${{ matrix.wkhtmltopdf }}" != "false" ]; then | |
| vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_disabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_disabled" --rerun || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_disabled" --rerun | |
| else | |
| vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" --rerun || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" --rerun || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" --rerun || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" --rerun | |
| fi | |
| - | |
| name: Upload Behat logs | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: "Behat logs - ${{ matrix.sylius }}-legacy_pdf_generation-${{ matrix.legacy_pdf_generation }}-${{ github.run_id }}-${{ github.run_number }}" | |
| path: etc/build/ | |
| if-no-files-found: ignore | |
| compression-level: 6 | |
| overwrite: true |