Skip to content

Pimcore Studio Integration #4237

Pimcore Studio Integration

Pimcore Studio Integration #4237

Workflow file for this run

name: Behat
on:
push:
branches: [ '5.0', 'next' ]
paths:
- 'composer.json'
- 'features/**'
- 'behat.yml.dist'
- '*.php'
- 'src/**'
- '.github/workflows/behat.yml'
pull_request:
branches: [ '5.0', 'next' ]
paths:
- 'composer.json'
- 'features/**'
- 'behat.yml.dist'
- '*.php'
- 'src/**'
- '.github/workflows/behat.yml'
release:
types: [ created ]
schedule:
- cron: "0 1 * * 1"
env:
APP_ENV: "test"
CORESHOP_SKIP_DB_SETUP: "1"
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/coreshop_test"
PIMCORE_INSTALL_ADMIN_USERNAME: "admin"
PIMCORE_INSTALL_ADMIN_PASSWORD: "admin"
PIMCORE_INSTALL_MYSQL_HOST_SOCKET: "127.0.0.1"
PIMCORE_INSTALL_MYSQL_USERNAME: "root"
PIMCORE_INSTALL_MYSQL_PASSWORD: "root"
PIMCORE_INSTALL_MYSQL_DATABASE: "coreshop_test"
PIMCORE_INSTALL_MYSQL_PORT: "3306"
PIMCORE_KERNEL_CLASS: 'Kernel'
PIMCORE_SECRET: "${{ secrets.PIMCORE_SECRET }}"
PIMCORE_INSTALL_ENCRYPTION_SECRET: "${{ secrets.PIMCORE_SECRET }}"
PIMCORE_INSTANCE_IDENTIFIER: "${{ secrets.PIMCORE_INSTANCE_IDENTIFIER }}"
PIMCORE_INSTALL_INSTANCE_IDENTIFIER: "${{ secrets.PIMCORE_INSTANCE_IDENTIFIER }}"
PIMCORE_INSTALL_PRODUCT_KEY: "${{ secrets.PIMCORE_PRODUCT_KEY }}"
PIMCORE_PRODUCT_KEY: "${{ secrets.PIMCORE_PRODUCT_KEY }}"
permissions:
contents: read
jobs:
behat:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- php: 8.3
pimcore: ^12.3
dependencies: highest
allow-failure: false
- php: 8.4
pimcore: ^12.3
dependencies: highest
allow-failure: true
services:
database:
image: "mysql:8"
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
opensearch:
image: "opensearchproject/opensearch:2.11.1"
env:
discovery.type: single-node
plugins.security.disabled: "true"
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
action.auto_create_index: "false"
ports:
- 9200:9200
name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}, Deps ${{ matrix.dependencies }}"
steps:
- name: Checkout PR head (only for pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Checkout PR head (for push or other events)
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
extensions: intl, gd, simpleXML, dom, exif, fileinfo, iconv, mbstring, mysqli, pdo_mysql, zip, zlib
- name: Check PHP Version
run: php -v
- name: Setup DB
run: |
mysql --host 127.0.0.1 --port ${{ job.services.database.ports['3306'] }} -uroot -proot -e "CREATE DATABASE coreshop_test CHARSET=utf8mb4;"
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: pimcore/pimcore
run: composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
- if: matrix.dependencies == 'highest'
name: Install dependencies highest
run: composer update --no-progress --prefer-dist --optimize-autoloader
- if: matrix.dependencies == 'lowest'
name: Install dependencies lowest
run: composer update --no-progress --prefer-dist --optimize-autoloader --prefer-lowest
- name: Cache clear
run: bin/console cache:clear
- name: Assets Install
run: bin/console assets:install --symlink
- name: Configure OpenSearch Client
run: |
mkdir -p config/local
cat > config/local/opensearch.yaml << 'EOF'
pimcore_open_search_client:
clients:
default:
hosts: ['http://127.0.0.1:9200']
ssl_verification: false
EOF
- name: Install Pimcore
run: PIMCORE_KERNEL_CLASS=Kernel vendor/bin/pimcore-install --env=test --skip-database-config
- name: Install Pimcore Bundles
run: |
bin/console pimcore:bundle:install --no-post-change-commands PimcoreApplicationLoggerBundle
bin/console pimcore:bundle:install --no-post-change-commands PimcoreCustomReportsBundle
bin/console pimcore:bundle:install --no-post-change-commands PimcoreGenericDataIndexBundle
bin/console pimcore:bundle:install --no-post-change-commands PimcoreGenericExecutionEngineBundle
bin/console pimcore:bundle:install --no-post-change-commands PimcoreSimpleBackendSearchBundle
bin/console pimcore:bundle:install --no-post-change-commands PimcoreStudioBackendBundle
bin/console pimcore:bundle:install --no-post-change-commands PimcoreStudioUiBundle
bin/console pimcore:deployment:classes-rebuild --force --create-classes
bin/console generic-data-index:update:index -r
- name: Install CoreShop
run: |
bin/console coreshop:install
- name: Run Behat
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist -p default