Sylius/.github/workflows/ci_e2e-mariadb.yaml
Loïc Frémont 992bdd4bc4 feat(php-grids): Tests with Legacy grid config
# Conflicts:
#	.github/workflows/ci_e2e-mariadb.yaml
#	.github/workflows/matrix.json
2026-06-30 09:57:20 +02:00

252 lines
12 KiB
YAML

name: Tests (MariaDB)
on:
workflow_dispatch: ~
workflow_call:
inputs:
branch:
description: "Branch"
required: false
type: string
default: ""
type:
description: "Type of the build"
required: true
type: string
permissions:
contents: read
jobs:
get-matrix:
runs-on: ubuntu-latest
name: "Get matrix"
outputs:
matrix: ${{ steps.matrix.outputs.prop }}
steps:
- name: "Checkout (With Branch)"
if: "${{ inputs.branch != '' }}"
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: "Checkout"
uses: actions/checkout@v4
if: "${{ inputs.branch == '' }}"
- name: "Get matrix"
id: matrix
uses: notiz-dev/github-action-json-property@release
with:
path: '.github/workflows/matrix.json'
prop_path: '${{ inputs.type }}.e2e-mariadb'
phpunit-cli-api:
needs: get-matrix
runs-on: ubuntu-latest
name: "PHPUnit, CLI, API, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}, State Machine Adapter ${{ matrix.state_machine_adapter }}${{ matrix.doctrine_bundle && format(', DoctrineBundle {0}', matrix.doctrine_bundle) || '' }}${{ matrix.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}${{ matrix.legacy_grid_config && format(', LegacyGridConfig {0}', matrix.legacy_grid_config) || '' }"
timeout-minutes: 20
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
env:
APP_ENV: test_cached
TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}"
TEST_SYLIUS_USE_LEGACY_GRID_CONFIG: ${{ matrix.legacy_grid_config || true }}
BEHAT_BASE_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f progress"
BEHAT_RERUN_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f pretty --rerun"
steps:
- name: "Checkout (With Branch)"
if: "${{ inputs.branch != '' }}"
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: "Checkout"
if: "${{ inputs.branch == '' }}"
uses: actions/checkout@v4
- 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: Require Doctrine Bundle
if: ${{ matrix.doctrine_bundle != '' && matrix.doctrine_bundle != null }}
run: composer require --no-update --no-scripts --no-interaction "doctrine/doctrine-bundle:${{ matrix.doctrine_bundle }}"
- name: Require DBAL 3.x for DoctrineBundle 2.x
if: ${{ matrix.doctrine_bundle == '^2.0' }}
run: composer require --no-update --no-scripts --no-interaction "doctrine/dbal:^3.9"
- name: Prepare manifest.json files
run: |
mkdir -p public/build/admin
mkdir -p public/build/shop
mkdir -p public/build/app/admin
mkdir -p public/build/app/shop
echo "{}" > public/build/admin/manifest.json
echo "{}" > public/build/shop/manifest.json
echo "{}" > public/build/app/admin/manifest.json
echo "{}" > public/build/app/shop/manifest.json
- name: Require Api Platform packages
if: ${{ matrix.api_platform != '' && matrix.api_platform != null }}
run: |
REQ="${{ matrix.api_platform }}"
composer require --no-update \
api-platform/doctrine-common:${REQ} \
api-platform/doctrine-orm:${REQ} \
api-platform/documentation:${REQ} \
api-platform/http-cache:${REQ} \
api-platform/hydra:${REQ} \
api-platform/json-schema:${REQ} \
api-platform/jsonld:${REQ} \
api-platform/metadata:${REQ} \
api-platform/openapi:${REQ} \
api-platform/serializer:${REQ} \
api-platform/state:${REQ} \
api-platform/symfony:${REQ} \
api-platform/validator:${REQ}
- name: Build application
uses: SyliusLabs/BuildTestAppAction@v4
with:
build_type: "sylius"
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-apip-${{ matrix.api_platform || 'none' }}-"
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-apip-${{ matrix.api_platform || 'none' }}-"
e2e: "yes"
database: "mariadb:${{ matrix.mariadb }}"
php_version: ${{ matrix.php }}
symfony_version: ${{ matrix.symfony }}
node_version: "24.x"
chrome_version: stable
- name: Run PHPUnit
run: |
vendor/bin/phpunit --testsuite all --colors=always
vendor/bin/phpunit --testsuite="Sylius Test Suite" --colors=always
- name: Run CLI Behat
run: |
$BEHAT_BASE_CMD --tags="@cli&&~@todo" --suite-tags="@cli" || \
$BEHAT_RERUN_CMD --tags="@cli&&~@todo" --suite-tags="@cli"
- name: Run API Behat
run: |
$BEHAT_BASE_CMD --tags="~@todo&&~@cli" --suite-tags="@api,@domain" || \
$BEHAT_RERUN_CMD --tags="~@todo&&~@cli" --suite-tags="@api,@domain"
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: "Logs (PHPUnit, CLI, API, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}) - ${{ github.run_id }}-${{ github.run_number }}"
path: |
etc/build/
var/log
if-no-files-found: ignore
overwrite: true
behat-ui:
needs: get-matrix
runs-on: ubuntu-latest
name: "UI, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}, State Machine Adapter ${{ matrix.state_machine_adapter }}${{ matrix.doctrine_bundle && format(', DoctrineBundle {0}', matrix.doctrine_bundle) || '' }}${{ matrix.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}${{ matrix.legacy_grid_config && format(', LegacyGridConfig {0}', matrix.legacy_grid_config) || '' }}"
timeout-minutes: 20
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
env:
APP_ENV: test_cached
TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}"
TEST_SYLIUS_USE_LEGACY_GRID_CONFIG: ${{ matrix.legacy_grid_config || true }}
BEHAT_BASE_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f progress"
BEHAT_RERUN_CMD: "vendor/bin/behat --colors --strict --no-interaction -vvv -f pretty --rerun"
steps:
- name: "Checkout (With Branch)"
if: "${{ inputs.branch != '' }}"
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: "Checkout"
if: "${{ inputs.branch == '' }}"
uses: actions/checkout@v4
- 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: Require Doctrine Bundle
if: ${{ matrix.doctrine_bundle != '' && matrix.doctrine_bundle != null }}
run: composer require --no-update --no-scripts --no-interaction "doctrine/doctrine-bundle:${{ matrix.doctrine_bundle }}"
- name: Require DBAL 3.x for DoctrineBundle 2.x
if: ${{ matrix.doctrine_bundle == '^2.0' }}
run: composer require --no-update --no-scripts --no-interaction "doctrine/dbal:^3.9"
- name: Prepare manifest.json files
run: |
mkdir -p public/build/admin
mkdir -p public/build/shop
mkdir -p public/build/app/admin
mkdir -p public/build/app/shop
echo "{}" > public/build/admin/manifest.json
echo "{}" > public/build/shop/manifest.json
echo "{}" > public/build/app/admin/manifest.json
echo "{}" > public/build/app/shop/manifest.json
- name: Require Api Platform packages
if: ${{ matrix.api_platform != '' && matrix.api_platform != null }}
run: |
REQ="${{ matrix.api_platform }}"
composer require --no-update \
api-platform/doctrine-common:${REQ} \
api-platform/doctrine-orm:${REQ} \
api-platform/documentation:${REQ} \
api-platform/http-cache:${REQ} \
api-platform/hydra:${REQ} \
api-platform/json-schema:${REQ} \
api-platform/jsonld:${REQ} \
api-platform/metadata:${REQ} \
api-platform/openapi:${REQ} \
api-platform/serializer:${REQ} \
api-platform/state:${REQ} \
api-platform/symfony:${REQ} \
api-platform/validator:${REQ}
- name: Build application
uses: SyliusLabs/BuildTestAppAction@v4
with:
build_type: "sylius"
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-apip-${{ matrix.api_platform || 'none' }}-"
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-apip-${{ matrix.api_platform || 'none' }}-"
e2e: "yes"
database: "mariadb:${{ matrix.mariadb }}"
php_version: ${{ matrix.php }}
symfony_version: ${{ matrix.symfony }}
node_version: "24.x"
chrome_version: stable
- name: Run UI Behat
run: |
$BEHAT_BASE_CMD --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui" || \
$BEHAT_RERUN_CMD --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli" --suite-tags="@hybrid,@ui"
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: "Logs (UI, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MariaDB ${{ matrix.mariadb }}) - ${{ github.run_id }}-${{ github.run_number }}"
path: |
etc/build/
var/log
if-no-files-found: ignore
overwrite: true