Sylius/.github/workflows/ci_e2e-pgsql.yaml
2023-12-04 14:25:08 +01:00

111 lines
4.9 KiB
YAML

name: End-to-End (PostgreSQL)
on:
workflow_dispatch: ~
workflow_call:
inputs:
branch:
description: "Branch"
required: false
type: string
default: ""
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-pgsql'
behat-no-js:
needs: get-matrix
runs-on: ubuntu-latest
name: "Non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, PostgreSQL ${{ matrix.postgres }}"
timeout-minutes: 45
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
env:
APP_ENV: test_cached
DATABASE_URL: "pgsql://postgres:postgres@127.0.0.1/sylius?charset=utf8&serverVersion=${{ matrix.postgres }}"
steps:
- name: Set variables
shell: bash
env:
BRANCH: ${{ inputs.branch }}
run: |
if [ "$BRANCH" == "1.12" ]; then
echo "USE_LEGACY_POSTGRES_SETUP=yes" >> $GITHUB_ENV
else
echo "USE_LEGACY_POSTGRES_SETUP=no" >> $GITHUB_ENV
fi
- name: "Checkout (With Branch)"
if: "${{ inputs.branch != '' }}"
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: "Checkout"
if: "${{ inputs.branch == '' }}"
uses: actions/checkout@v3
- 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: Build application
uses: SyliusLabs/BuildTestAppAction@v2.2
with:
build_type: "sylius"
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-"
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-"
e2e: "yes"
database: "postgresql"
database_version: ${{ matrix.postgres }}
legacy_postgresql_setup: ${{ env.USE_LEGACY_POSTGRES_SETUP }}
php_version: ${{ matrix.php }}
symfony_version: ${{ matrix.symfony }}
- 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" --suite-tags="@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" --rerun
- name: Run non-UI Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain,@hybrid" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain,@hybrid" --rerun
- name: Run non-JS Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@ui" --rerun
- name: Upload logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, PostgreSQL ${{ matrix.postgres }})"
path: |
etc/build/
var/log
if-no-files-found: ignore