mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
152 lines
7.5 KiB
YAML
152 lines
7.5 KiB
YAML
name: End-to-End (MySQL)
|
|
|
|
on:
|
|
workflow_dispatch: ~
|
|
workflow_call:
|
|
inputs:
|
|
type:
|
|
description: "Type of the build"
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
get-matrix:
|
|
runs-on: ubuntu-latest
|
|
name: "Get matrix"
|
|
outputs:
|
|
matrix: ${{ steps.matrix.outputs.prop }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
-
|
|
name: "Get matrix"
|
|
id: matrix
|
|
uses: notiz-dev/github-action-json-property@release
|
|
with:
|
|
path: '.github/workflows/matrix.json'
|
|
prop_path: '${{ inputs.type }}.e2e-mysql'
|
|
|
|
behat-no-js:
|
|
needs: get-matrix
|
|
runs-on: ubuntu-latest
|
|
name: "Non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, Twig ${{ matrix.twig }}, DBAL ${{ matrix.dbal }}.x, API Platform ${{ matrix.api-platform }}"
|
|
timeout-minutes: 45
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
|
|
|
|
env:
|
|
APP_ENV: test_cached
|
|
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?charset=utf8mb4&serverVersion=${{ matrix.mysql }}"
|
|
|
|
steps:
|
|
-
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get Composer cache directory
|
|
id: composer-cache
|
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: "Restore dependencies"
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
restore-keys: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
|
|
- name: Restrict Twig
|
|
if: matrix.twig == '^2.12'
|
|
run: composer require --no-update --no-scripts --no-interaction "twig/twig:${{ matrix.twig }}"
|
|
|
|
- name: Restrict DBAL
|
|
if: matrix.dbal == '^2.7'
|
|
run: composer require --no-update --no-scripts --no-interaction "doctrine/dbal:${{ matrix.dbal }}"
|
|
|
|
- name: Build application
|
|
uses: jakubtobiasz/SyliusBuildTestAppAction@v2.0
|
|
with:
|
|
build_type: "sylius"
|
|
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
e2e: "yes"
|
|
database_version: ${{ matrix.mysql }}
|
|
php_version: ${{ matrix.php }}
|
|
symfony_version: ${{ matrix.symfony }}
|
|
|
|
- name: Test installer
|
|
run: bin/console sylius:install --no-interaction -vvv
|
|
|
|
- name: Run PHPUnit
|
|
run: vendor/bin/phpunit --colors=always
|
|
|
|
- name: Run CLI Behat
|
|
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --rerun
|
|
|
|
- name: Run non-JS Behat
|
|
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@todo&&~@cli&&~@no-postgres" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@todo&&~@cli&&~@no-postgres" --rerun
|
|
|
|
- name: Upload Behat logs
|
|
uses: actions/upload-artifact@v3
|
|
if: failure()
|
|
with:
|
|
name: "Behat logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}), ApiPlatform ${{ matrix.api-platform }}, Twig ${{ matrix.twig }}, MySQL ${{ matrix.mysql }}, DBAL ${{ matrix.dbal }}"
|
|
path: etc/build/
|
|
if-no-files-found: ignore
|
|
|
|
behat-ui-js:
|
|
needs: get-matrix
|
|
runs-on: ubuntu-latest
|
|
name: "JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, Twig ${{ matrix.twig }}, DBAL ${{ matrix.dbal }}, API Platform ${{ matrix.api-platform }}"
|
|
timeout-minutes: 45
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
|
|
|
|
env:
|
|
APP_ENV: test_cached
|
|
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?charset=utf8mb4&serverVersion=${{ matrix.mysql }}"
|
|
|
|
steps:
|
|
-
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get Composer cache directory
|
|
id: composer-cache
|
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: "Restore dependencies"
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
restore-keys: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
|
|
- name: Restrict Twig
|
|
if: matrix.twig == '^2.12'
|
|
run: composer require --no-update --no-scripts --no-interaction "twig/twig:${{ matrix.twig }}"
|
|
|
|
- name: Restrict DBAL
|
|
if: matrix.dbal == '^2.7'
|
|
run: composer require --no-update --no-scripts --no-interaction "doctrine/dbal:${{ matrix.dbal }}"
|
|
|
|
- name: Build application
|
|
uses: jakubtobiasz/SyliusBuildTestAppAction@v2.0
|
|
with:
|
|
build_type: "sylius"
|
|
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}-api-platform-${{ matrix.api-platform }}"
|
|
e2e: "yes"
|
|
e2e_js: "yes"
|
|
database_version: ${{ matrix.mysql }}
|
|
php_version: ${{ matrix.php }}
|
|
symfony_version: ${{ matrix.symfony }}
|
|
|
|
- name: Run Behat
|
|
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@api" ||vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@api" --rerun
|
|
|
|
- name: Upload Behat logs
|
|
uses: actions/upload-artifact@v3
|
|
if: failure()
|
|
with:
|
|
name: "Behat logs (JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, ApiPlatform ${{ matrix.api-platform }}, Twig ${{ matrix.twig }}, MySQL ${{ matrix.mysql }}, DBAL ${{ matrix.dbal }})"
|
|
path: etc/build/
|
|
if-no-files-found: ignore
|