Sylius/.github/workflows/ci_e2e-mariadb.yaml
Kamil Grygierzec 0f9ef6b458
[UPMERGE] 2.1 -> 2.2 (#18839)
This PR has been generated automatically.
For more details see
[upmerge_pr.yaml](/Sylius/Sylius/blob/2.3/.github/workflows/upmerge_pr.yaml).

**Remember!** The upmerge should always be merged with using `Merge pull
request` button.

In case of conflicts, please resolve them manually with usign the
following commands:
```
git fetch upstream
gh pr checkout <this-pr-number>
git merge upstream/2.2 -m "Resolve conflicts between 2.1 and 2.2"
```

If you use other name for the upstream remote, please replace `upstream`
with the name of your remote pointing to the `Sylius/Sylius` repository.

Once the conflicts are resolved, please run `git merge --continue` and
push the changes to this PR.
2026-02-18 09:31:35 +01:00

258 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.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}"
timeout-minutes: 15
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 }}"
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: Set variables
shell: bash
env:
BRANCH: ${{ inputs.branch }}
run: |
if [ "$BRANCH" == "1.14" ]; then
echo "NODE_VERSION=20.x" >> $GITHUB_ENV
else
echo "NODE_VERSION=24.x" >> $GITHUB_ENV
fi
- 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: Prepare manifest.json files
if: "${{ inputs.branch != '1.14' }}"
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: ${{ env.NODE_VERSION }}
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.api_platform && format(', ApiPlatform {0}', matrix.api_platform) || '' }}"
timeout-minutes: 15
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 }}"
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: Set variables
shell: bash
env:
BRANCH: ${{ inputs.branch }}
run: |
if [ "$BRANCH" == "1.14" ]; then
echo "NODE_VERSION=20.x" >> $GITHUB_ENV
else
echo "NODE_VERSION=24.x" >> $GITHUB_ENV
fi
- 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: Prepare manifest.json files
if: "${{ inputs.branch != '1.14' }}"
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: ${{ env.NODE_VERSION }}
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