From 5e8c7f12f539c663c9fd8b8c2b663fcd03569ef3 Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 10:42:09 +0000 Subject: [PATCH 1/8] Change ci composer --- .github/ci/files/composer.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/ci/files/composer.json b/.github/ci/files/composer.json index 94074c67..c3507570 100644 --- a/.github/ci/files/composer.json +++ b/.github/ci/files/composer.json @@ -16,11 +16,10 @@ "pimcore/generic-data-index-bundle": "@dev" }, "require-dev": { - "codeception/codeception": "^5.3.2", - "codeception/phpunit-wrapper": "^9", - "codeception/module-asserts": "^2", - "codeception/module-symfony": "^3.1.1", - "phpunit/phpunit": "10.2.7" + "codeception/codeception": "^5.3.4", + "codeception/module-asserts": "^3.0", + "codeception/module-symfony": "^3.7.1", + "phpunit/phpunit": "^10.5" }, "autoload": { "psr-4": { From 8ea3b67cdcb9aca26cf78f8b59764be5575f9a38 Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 11:01:51 +0000 Subject: [PATCH 2/8] use centralized workflow --- .github/ci/files/composer.json | 45 ------ .../workflows/elastic-search-codeception.yaml | 129 ++++-------------- .../workflows/open-search-codeception.yaml | 121 ++++------------ 3 files changed, 54 insertions(+), 241 deletions(-) delete mode 100644 .github/ci/files/composer.json diff --git a/.github/ci/files/composer.json b/.github/ci/files/composer.json deleted file mode 100644 index c3507570..00000000 --- a/.github/ci/files/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "type": "project", - "config": { - "optimize-autoloader": true, - "sort-packages": true, - "discard-changes": true, - "process-timeout": 0, - "allow-plugins": { - "php-http/discovery": false, - "symfony/runtime": true - } - }, - "prefer-stable": true, - "minimum-stability": "dev", - "require": { - "pimcore/generic-data-index-bundle": "@dev" - }, - "require-dev": { - "codeception/codeception": "^5.3.4", - "codeception/module-asserts": "^3.0", - "codeception/module-symfony": "^3.7.1", - "phpunit/phpunit": "^10.5" - }, - "autoload": { - "psr-4": { - "App\\": "src/", - "Pimcore\\Model\\DataObject\\": "var/classes/DataObject" - }, - "files": [ - "kernel/Kernel.php" - ] - }, - "extra": { - "symfony-assets-install": "relative" - }, - "repositories": { - "bundles": { - "type": "path", - "url": "./bundles/*/*", - "options": { - "symlink": true - } - } - } -} diff --git a/.github/workflows/elastic-search-codeception.yaml b/.github/workflows/elastic-search-codeception.yaml index b1495507..4ec601e1 100644 --- a/.github/workflows/elastic-search-codeception.yaml +++ b/.github/workflows/elastic-search-codeception.yaml @@ -1,9 +1,8 @@ name: "Codeception Tests with Elasticsearch" on: - # Enable Later. schedule: - - cron: '0 3 * * 1,3,5' + - cron: "0 3 * * 1,3,5" workflow_dispatch: pull_request: branches: @@ -15,109 +14,33 @@ on: - "[0-9]+.[0-9]+" - "[0-9]+.x" -env: - PIMCORE_PROJECT_ROOT: ${{ github.workspace }} - APP_ENV: test - PIMCORE_TEST: 1 - PIMCORE_TEST_DB_DSN: "mysql://root@127.0.0.1:33006/pimcore_test" - PIMCORE_ELASTIC_SEARCH_HOST: "localhost:5300" - CODECEPTION_BUNDLE_PATH: "bundles/pimcore/generic-data-index-bundle/" - PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} - PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} - PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }} - jobs: codeception-tests: - name: "Codeception tests" - runs-on: "ubuntu-latest" - continue-on-error: ${{ matrix.experimental }} strategy: matrix: include: - - { php-version: "8.4", dependencies: "highest", pimcore_version: "12.x-dev as 12.99.9", experimental: true, search_engine: "elasticsearch"} - - services: - mariadb: - image: "mariadb:10.11" - ports: - - 33006:3306 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - - elastic: - image: elasticsearch:8.5.3 - ports: - - 5300:9200 - env: - discovery.type: "single-node" - ES_JAVA_OPTS: "-Xms1g -Xmx1g" - xpack.security.enabled: "true" - xpack.security.authc.anonymous.roles: "superuser,kibana_admin,kibana_system,kibana_user" - ELASTIC_USERNAME: "elastic" - ELASTIC_PASSWORD: "somethingsecret" - - steps: - - name: "Checkout code" - uses: "actions/checkout@v4" - with: - path: "bundles/pimcore/generic-data-index-bundle" - - - name: "Copy .github directory" - env: - REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}" - run: | - cp -R bundles/pimcore/generic-data-index-bundle/.github .github - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: xdebug - ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767 - php-version: "${{ matrix.php-version }}" - - - name: Verify MariaDB connection - run: | - cp .github/ci/files/.my.cnf ~/.my.cnf - while ! mysqladmin ping --silent; do - sleep 1 - done - - - name: "Setup Pimcore environment" - env: - REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}" - run: | - mysql -e "CREATE DATABASE pimcore_test CHARSET=utf8mb4;" - cp -R bundles/pimcore/generic-data-index-bundle/tests tests - mkdir src - chmod 755 .github/ci/scripts/setup-pimcore-environment-functional-tests.sh - .github/ci/scripts/setup-pimcore-environment-functional-tests.sh "${{ matrix.search_engine }}" - - - name: "Wait for Elasticsearch to be up" - run: | - if [ "${{ matrix.search_engine }}" == "elasticsearch" ]; then - echo "Waiting for Elasticsearch to be ready..." - until curl -s -u elastic:somethingsecret http://localhost:5300/_cluster/health | grep -q '"status":"green"'; do - echo "Waiting... Elasticsearch is not yet available." - sleep 5 - done - echo "Elasticsearch is up and running!" - else - echo "Using OpenSearch for testing, skipping Elasticsearch wait." - fi - - - name: "Update Pimcore version" - env: - PIMCORE_VERSION: "${{ matrix.pimcore_version }}" - run: | - if [ ! -z "$PIMCORE_VERSION" ]; then - composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}" - fi - - - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "${{ matrix.dependencies }}" - - - name: "Run Codeception" - run: | - vendor/bin/codecept run -c . -vvv --xml --coverage-xml + - { + php-version: "8.4", + dependencies: "highest", + pimcore_version: "12.x-dev as 12.99.9", + experimental: true, + } + uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main + with: + APP_ENV: test + PIMCORE_TEST: "1" + PRIVATE_REPO: "false" + PHP_VERSION: ${{ matrix.php-version }} + DATABASE: "mariadb:10.11" + DEPENDENCIES: ${{ matrix.dependencies }} + EXPERIMENTAL: ${{ matrix.experimental }} + PIMCORE_VERSION: ${{ matrix.pimcore_version }} + REQUIRE_ADMIN_BUNDLE: "false" + PIMCORE_ELASTIC_SEARCH_HOST: "39201" + PIMCORE_ELASTIC_SEARCH_VERSION: "8.5.3" + ENABLE_ELASTICSEARCH: true + COVERAGE: "xdebug" + secrets: + PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} + PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} + PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }} diff --git a/.github/workflows/open-search-codeception.yaml b/.github/workflows/open-search-codeception.yaml index 05c97135..91413900 100644 --- a/.github/workflows/open-search-codeception.yaml +++ b/.github/workflows/open-search-codeception.yaml @@ -1,9 +1,8 @@ name: "Codeception Tests with OpenSearch" on: - # Enable Later. schedule: - - cron: '0 3 * * 1,3,5' + - cron: "0 3 * * 1,3,5" workflow_dispatch: pull_request: branches: @@ -15,99 +14,35 @@ on: - "[0-9]+.[0-9]+" - "[0-9]+.x" -env: - PIMCORE_PROJECT_ROOT: ${{ github.workspace }} - APP_ENV: test - PIMCORE_TEST: 1 - PIMCORE_TEST_DB_DSN: "mysql://root@127.0.0.1:33006/pimcore_test" - PIMCORE_OPEN_SEARCH_HOST: "localhost:39200" - CODECEPTION_BUNDLE_PATH: "bundles/pimcore/generic-data-index-bundle/" - PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} - PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} - PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }} - jobs: codeception-tests: - name: "Codeception tests" - runs-on: "ubuntu-latest" - continue-on-error: ${{ matrix.experimental }} strategy: matrix: include: - - { php-version: "8.3", dependencies: "lowest", pimcore_version: "", experimental: false, search_engine: "openSearch" } - - { php-version: "8.4", dependencies: "highest", pimcore_version: "", experimental: false, search_engine: "openSearch"} - - { php-version: "8.4", dependencies: "highest", pimcore_version: "12.x-dev as 12.99.9", experimental: true, search_engine: "openSearch"} - - services: - mariadb: - image: "mariadb:10.11" - ports: - - 33006:3306 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - - opensearch: - image: opensearchproject/opensearch:2 - ports: - - 39200:9200 - env: - cluster.name: "opensearch-cluster" - node.name: "opensearch-node" - discovery.seed_hosts: "opensearch-node" - bootstrap.memory_lock: true - OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m" - discovery.type: "single-node" - DISABLE_SECURITY_PLUGIN: true - - steps: - - name: "Checkout code" - uses: "actions/checkout@v4" - with: - path: "bundles/pimcore/generic-data-index-bundle" - - - name: "Copy .github directory" - env: - REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}" - run: | - cp -R bundles/pimcore/generic-data-index-bundle/.github .github - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: xdebug - ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767 - php-version: "${{ matrix.php-version }}" - - - name: Verify MariaDB connection - run: | - cp .github/ci/files/.my.cnf ~/.my.cnf - while ! mysqladmin ping --silent; do - sleep 1 - done - - - name: "Setup Pimcore environment" - env: - REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}" - run: | - mysql -e "CREATE DATABASE pimcore_test CHARSET=utf8mb4;" - cp -R bundles/pimcore/generic-data-index-bundle/tests tests - mkdir src - chmod 755 .github/ci/scripts/setup-pimcore-environment-functional-tests.sh - .github/ci/scripts/setup-pimcore-environment-functional-tests.sh "${{ matrix.search_engine }}" - - - name: "Update Pimcore version" - env: - PIMCORE_VERSION: "${{ matrix.pimcore_version }}" - run: | - if [ ! -z "$PIMCORE_VERSION" ]; then - composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}" - fi - - - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "${{ matrix.dependencies }}" - - - name: "Run Codeception" - run: | - vendor/bin/codecept run -c . -vvv --xml --coverage-xml + - { php-version: "8.3", dependencies: "lowest", pimcore_version: "", experimental: false } + - { php-version: "8.4", dependencies: "highest", pimcore_version: "", experimental: false } + - { + php-version: "8.4", + dependencies: "highest", + pimcore_version: "12.x-dev as 12.99.9", + experimental: true, + } + uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main + with: + APP_ENV: test + PIMCORE_TEST: "1" + PRIVATE_REPO: "false" + PHP_VERSION: ${{ matrix.php-version }} + DATABASE: "mariadb:10.11" + DEPENDENCIES: ${{ matrix.dependencies }} + EXPERIMENTAL: ${{ matrix.experimental }} + PIMCORE_VERSION: ${{ matrix.pimcore_version }} + REQUIRE_ADMIN_BUNDLE: "false" + PIMCORE_OPEN_SEARCH_HOST: "39200" + PIMCORE_OPENSEARCH_VERSION: "2" + ENABLE_ELASTICSEARCH: false + COVERAGE: "xdebug" + secrets: + PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} + PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} + PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }} From 12b70d2c203ed130a6a82814fda336c6268be47e Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 12:22:28 +0000 Subject: [PATCH 3/8] Fix: tests --- .../ci/scripts/setup-pimcore-environment.sh | 1 - .../workflows/elastic-search-codeception.yaml | 73 ++++++++++++++++-- .../workflows/open-search-codeception.yaml | 75 ++++++++++++++++--- 3 files changed, 130 insertions(+), 19 deletions(-) diff --git a/.github/ci/scripts/setup-pimcore-environment.sh b/.github/ci/scripts/setup-pimcore-environment.sh index ac32e84e..29e5a1d7 100755 --- a/.github/ci/scripts/setup-pimcore-environment.sh +++ b/.github/ci/scripts/setup-pimcore-environment.sh @@ -5,7 +5,6 @@ set -eu mkdir -p var/config mkdir -p bin -cp .github/ci/files/.env . cp -r .github/ci/files/config/. config cp -r .github/ci/files/templates/. templates cp -r .github/ci/files/bin/console bin/console diff --git a/.github/workflows/elastic-search-codeception.yaml b/.github/workflows/elastic-search-codeception.yaml index 4ec601e1..17d9d5ad 100644 --- a/.github/workflows/elastic-search-codeception.yaml +++ b/.github/workflows/elastic-search-codeception.yaml @@ -15,16 +15,73 @@ on: - "[0-9]+.x" jobs: + setup-matrix: + runs-on: ubuntu-latest + outputs: + php_versions: ${{ steps.parse-php-versions.outputs.php_versions }} + matrix: ${{ steps.set-matrix.outputs.matrix }} + private_repo: ${{ env.PRIVATE_REPO }} + steps: + - name: Checkout PR head (only for pull_request_target) + if: github.event_name == 'pull_request_target' + uses: "actions/checkout@v4" + with: + ref: "refs/pull/${{ github.event.pull_request.number }}/merge" + + - name: Checkout PR head (for push or other events) + if: github.event_name != 'pull_request_target' + uses: "actions/checkout@v4" + + - name: Checkout reusable workflow repo + uses: actions/checkout@v4 + with: + repository: pimcore/workflows-collection-public + ref: main + path: reusable-workflows + + - name: Parse PHP versions from composer.json + id: parse-php-versions + run: | + if [ -f composer.json ]; then + php_versions=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | tr '\n' ',' | sed 's/,$//') + if [ -z "$php_versions" ]; then + echo "No PHP versions found in composer.json" + echo "Setting default PHP value" + echo "php_versions=default" >> $GITHUB_OUTPUT + else + echo "php_versions=$php_versions" >> $GITHUB_OUTPUT + echo "#### php versions #### : $php_versions" + fi + else + echo "composer.json not found" + exit 1 + fi + + - name: Set up matrix + id: set-matrix + run: | + php_versions="${{ steps.parse-php-versions.outputs.php_versions }}" + + MATRIX_JSON=$(cat reusable-workflows/codeception-tests-configuration/matrix-config.json) + + IFS=',' read -ra VERSIONS_ARRAY <<< "$php_versions" + + FILTERED_MATRIX_JSON=$(echo $MATRIX_JSON | jq --arg php_versions "$php_versions" ' + { + matrix: [ + .configs[] | + select(.php_version == $php_versions) | + .matrix[] + ] + }') + + ENCODED_MATRIX_JSON=$(echo $FILTERED_MATRIX_JSON | jq -c .) + + echo "matrix=${ENCODED_MATRIX_JSON}" >> $GITHUB_OUTPUT + codeception-tests: strategy: - matrix: - include: - - { - php-version: "8.4", - dependencies: "highest", - pimcore_version: "12.x-dev as 12.99.9", - experimental: true, - } + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main with: APP_ENV: test diff --git a/.github/workflows/open-search-codeception.yaml b/.github/workflows/open-search-codeception.yaml index 91413900..7cd15b89 100644 --- a/.github/workflows/open-search-codeception.yaml +++ b/.github/workflows/open-search-codeception.yaml @@ -15,18 +15,73 @@ on: - "[0-9]+.x" jobs: + setup-matrix: + runs-on: ubuntu-latest + outputs: + php_versions: ${{ steps.parse-php-versions.outputs.php_versions }} + matrix: ${{ steps.set-matrix.outputs.matrix }} + private_repo: ${{ env.PRIVATE_REPO }} + steps: + - name: Checkout PR head (only for pull_request_target) + if: github.event_name == 'pull_request_target' + uses: "actions/checkout@v4" + with: + ref: "refs/pull/${{ github.event.pull_request.number }}/merge" + + - name: Checkout PR head (for push or other events) + if: github.event_name != 'pull_request_target' + uses: "actions/checkout@v4" + + - name: Checkout reusable workflow repo + uses: actions/checkout@v4 + with: + repository: pimcore/workflows-collection-public + ref: main + path: reusable-workflows + + - name: Parse PHP versions from composer.json + id: parse-php-versions + run: | + if [ -f composer.json ]; then + php_versions=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | tr '\n' ',' | sed 's/,$//') + if [ -z "$php_versions" ]; then + echo "No PHP versions found in composer.json" + echo "Setting default PHP value" + echo "php_versions=default" >> $GITHUB_OUTPUT + else + echo "php_versions=$php_versions" >> $GITHUB_OUTPUT + echo "#### php versions #### : $php_versions" + fi + else + echo "composer.json not found" + exit 1 + fi + + - name: Set up matrix + id: set-matrix + run: | + php_versions="${{ steps.parse-php-versions.outputs.php_versions }}" + + MATRIX_JSON=$(cat reusable-workflows/codeception-tests-configuration/matrix-config.json) + + IFS=',' read -ra VERSIONS_ARRAY <<< "$php_versions" + + FILTERED_MATRIX_JSON=$(echo $MATRIX_JSON | jq --arg php_versions "$php_versions" ' + { + matrix: [ + .configs[] | + select(.php_version == $php_versions) | + .matrix[] + ] + }') + + ENCODED_MATRIX_JSON=$(echo $FILTERED_MATRIX_JSON | jq -c .) + + echo "matrix=${ENCODED_MATRIX_JSON}" >> $GITHUB_OUTPUT + codeception-tests: strategy: - matrix: - include: - - { php-version: "8.3", dependencies: "lowest", pimcore_version: "", experimental: false } - - { php-version: "8.4", dependencies: "highest", pimcore_version: "", experimental: false } - - { - php-version: "8.4", - dependencies: "highest", - pimcore_version: "12.x-dev as 12.99.9", - experimental: true, - } + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix).matrix }} uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main with: APP_ENV: test From 1dcbf7933ca71da2a77aff8fe0d2378d5f25b3cc Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 12:29:14 +0000 Subject: [PATCH 4/8] Fix: tests --- .github/workflows/elastic-search-codeception.yaml | 9 +++++---- .github/workflows/open-search-codeception.yaml | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/elastic-search-codeception.yaml b/.github/workflows/elastic-search-codeception.yaml index 17d9d5ad..bad7f91f 100644 --- a/.github/workflows/elastic-search-codeception.yaml +++ b/.github/workflows/elastic-search-codeception.yaml @@ -80,6 +80,7 @@ jobs: echo "matrix=${ENCODED_MATRIX_JSON}" >> $GITHUB_OUTPUT codeception-tests: + needs: setup-matrix strategy: matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main @@ -87,11 +88,11 @@ jobs: APP_ENV: test PIMCORE_TEST: "1" PRIVATE_REPO: "false" - PHP_VERSION: ${{ matrix.php-version }} + PHP_VERSION: ${{ matrix.matrix.php-version }} DATABASE: "mariadb:10.11" - DEPENDENCIES: ${{ matrix.dependencies }} - EXPERIMENTAL: ${{ matrix.experimental }} - PIMCORE_VERSION: ${{ matrix.pimcore_version }} + DEPENDENCIES: ${{ matrix.matrix.dependencies }} + EXPERIMENTAL: ${{ matrix.matrix.experimental }} + PIMCORE_VERSION: ${{ matrix.matrix.pimcore_version }} REQUIRE_ADMIN_BUNDLE: "false" PIMCORE_ELASTIC_SEARCH_HOST: "39201" PIMCORE_ELASTIC_SEARCH_VERSION: "8.5.3" diff --git a/.github/workflows/open-search-codeception.yaml b/.github/workflows/open-search-codeception.yaml index 7cd15b89..6e7c8dc0 100644 --- a/.github/workflows/open-search-codeception.yaml +++ b/.github/workflows/open-search-codeception.yaml @@ -80,6 +80,7 @@ jobs: echo "matrix=${ENCODED_MATRIX_JSON}" >> $GITHUB_OUTPUT codeception-tests: + needs: setup-matrix strategy: matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix).matrix }} uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main @@ -87,11 +88,11 @@ jobs: APP_ENV: test PIMCORE_TEST: "1" PRIVATE_REPO: "false" - PHP_VERSION: ${{ matrix.php-version }} + PHP_VERSION: ${{ matrix.matrix.php-version }} DATABASE: "mariadb:10.11" - DEPENDENCIES: ${{ matrix.dependencies }} - EXPERIMENTAL: ${{ matrix.experimental }} - PIMCORE_VERSION: ${{ matrix.pimcore_version }} + DEPENDENCIES: ${{ matrix.matrix.dependencies }} + EXPERIMENTAL: ${{ matrix.matrix.experimental }} + PIMCORE_VERSION: ${{ matrix.matrix.pimcore_version }} REQUIRE_ADMIN_BUNDLE: "false" PIMCORE_OPEN_SEARCH_HOST: "39200" PIMCORE_OPENSEARCH_VERSION: "2" From a0b5b300876d82bb0d7e6d567abb4dc0ee84ed16 Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 12:39:34 +0000 Subject: [PATCH 5/8] Fix: tests --- .github/workflows/elastic-search-codeception.yaml | 7 +++++++ .github/workflows/open-search-codeception.yaml | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/elastic-search-codeception.yaml b/.github/workflows/elastic-search-codeception.yaml index bad7f91f..668543da 100644 --- a/.github/workflows/elastic-search-codeception.yaml +++ b/.github/workflows/elastic-search-codeception.yaml @@ -13,6 +13,13 @@ on: branches: - "[0-9]+.[0-9]+" - "[0-9]+.x" +env: + PIMCORE_PROJECT_ROOT: ${{ github.workspace }} + PRIVATE_REPO: ${{ github.event.repository.private }} + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true jobs: setup-matrix: diff --git a/.github/workflows/open-search-codeception.yaml b/.github/workflows/open-search-codeception.yaml index 6e7c8dc0..687581fd 100644 --- a/.github/workflows/open-search-codeception.yaml +++ b/.github/workflows/open-search-codeception.yaml @@ -14,6 +14,14 @@ on: - "[0-9]+.[0-9]+" - "[0-9]+.x" +env: + PIMCORE_PROJECT_ROOT: ${{ github.workspace }} + PRIVATE_REPO: ${{ github.event.repository.private }} + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: setup-matrix: runs-on: ubuntu-latest @@ -82,7 +90,7 @@ jobs: codeception-tests: needs: setup-matrix strategy: - matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix).matrix }} + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main with: APP_ENV: test From f61048873a8ee298f995b5784a3589eea0c8cdfc Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 12:57:24 +0000 Subject: [PATCH 6/8] Fix: Tests --- .../setup-pimcore-environment-functional-tests.sh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 .github/ci/scripts/setup-pimcore-environment-functional-tests.sh diff --git a/.github/ci/scripts/setup-pimcore-environment-functional-tests.sh b/.github/ci/scripts/setup-pimcore-environment-functional-tests.sh deleted file mode 100755 index 00e1bd81..00000000 --- a/.github/ci/scripts/setup-pimcore-environment-functional-tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -.github/ci/scripts/setup-pimcore-environment.sh - -# Add Elasticsearch config if specified -if [ "$1" == "elasticsearch" ]; then - CONFIG_FILE_PATH="config/packages/test/config.yaml" - echo -e "\n# Added by functional test script\npimcore_generic_data_index:\n index_service:\n client_params:\n client_type: 'elasticsearch'" >> "$CONFIG_FILE_PATH" -fi - -cp .github/ci/files/composer.json . -cp bundles/pimcore/generic-data-index-bundle/codeception.dist.yml . \ No newline at end of file From 5556054aad1286830fc09ab4ee4a6f7ebbe809cf Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 13:09:58 +0000 Subject: [PATCH 7/8] Fix: Tests --- .../workflows/elastic-search-codeception.yaml | 40 ++++--------------- .../workflows/open-search-codeception.yaml | 40 ++++--------------- 2 files changed, 16 insertions(+), 64 deletions(-) diff --git a/.github/workflows/elastic-search-codeception.yaml b/.github/workflows/elastic-search-codeception.yaml index 668543da..1b575592 100644 --- a/.github/workflows/elastic-search-codeception.yaml +++ b/.github/workflows/elastic-search-codeception.yaml @@ -29,15 +29,8 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} private_repo: ${{ env.PRIVATE_REPO }} steps: - - name: Checkout PR head (only for pull_request_target) - if: github.event_name == 'pull_request_target' - uses: "actions/checkout@v4" - with: - ref: "refs/pull/${{ github.event.pull_request.number }}/merge" - - - name: Checkout PR head (for push or other events) - if: github.event_name != 'pull_request_target' - uses: "actions/checkout@v4" + - name: Checkout code + uses: actions/checkout@v4 - name: Checkout reusable workflow repo uses: actions/checkout@v4 @@ -52,39 +45,22 @@ jobs: if [ -f composer.json ]; then php_versions=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | tr '\n' ',' | sed 's/,$//') if [ -z "$php_versions" ]; then - echo "No PHP versions found in composer.json" - echo "Setting default PHP value" - echo "php_versions=default" >> $GITHUB_OUTPUT + echo "php_versions=default" >> "$GITHUB_OUTPUT" else - echo "php_versions=$php_versions" >> $GITHUB_OUTPUT - echo "#### php versions #### : $php_versions" + echo "php_versions=$php_versions" >> "$GITHUB_OUTPUT" fi else - echo "composer.json not found" exit 1 fi - - name: Set up matrix + - name: Set up matrix JSON id: set-matrix run: | php_versions="${{ steps.parse-php-versions.outputs.php_versions }}" - MATRIX_JSON=$(cat reusable-workflows/codeception-tests-configuration/matrix-config.json) - - IFS=',' read -ra VERSIONS_ARRAY <<< "$php_versions" - - FILTERED_MATRIX_JSON=$(echo $MATRIX_JSON | jq --arg php_versions "$php_versions" ' - { - matrix: [ - .configs[] | - select(.php_version == $php_versions) | - .matrix[] - ] - }') - - ENCODED_MATRIX_JSON=$(echo $FILTERED_MATRIX_JSON | jq -c .) - - echo "matrix=${ENCODED_MATRIX_JSON}" >> $GITHUB_OUTPUT + FILTERED_MATRIX_JSON=$(echo "$MATRIX_JSON" | jq --arg php_versions "$php_versions" '{ matrix: [ .configs[] | select(.php_version == $php_versions) | .matrix[] ] }') + ENCODED_MATRIX_JSON=$(echo "$FILTERED_MATRIX_JSON" | jq -c .) + echo "matrix=$ENCODED_MATRIX_JSON" >> "$GITHUB_OUTPUT" codeception-tests: needs: setup-matrix diff --git a/.github/workflows/open-search-codeception.yaml b/.github/workflows/open-search-codeception.yaml index 687581fd..e3f6b6a1 100644 --- a/.github/workflows/open-search-codeception.yaml +++ b/.github/workflows/open-search-codeception.yaml @@ -30,15 +30,8 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} private_repo: ${{ env.PRIVATE_REPO }} steps: - - name: Checkout PR head (only for pull_request_target) - if: github.event_name == 'pull_request_target' - uses: "actions/checkout@v4" - with: - ref: "refs/pull/${{ github.event.pull_request.number }}/merge" - - - name: Checkout PR head (for push or other events) - if: github.event_name != 'pull_request_target' - uses: "actions/checkout@v4" + - name: Checkout code + uses: actions/checkout@v4 - name: Checkout reusable workflow repo uses: actions/checkout@v4 @@ -53,39 +46,22 @@ jobs: if [ -f composer.json ]; then php_versions=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | tr '\n' ',' | sed 's/,$//') if [ -z "$php_versions" ]; then - echo "No PHP versions found in composer.json" - echo "Setting default PHP value" - echo "php_versions=default" >> $GITHUB_OUTPUT + echo "php_versions=default" >> "$GITHUB_OUTPUT" else - echo "php_versions=$php_versions" >> $GITHUB_OUTPUT - echo "#### php versions #### : $php_versions" + echo "php_versions=$php_versions" >> "$GITHUB_OUTPUT" fi else - echo "composer.json not found" exit 1 fi - - name: Set up matrix + - name: Set up matrix JSON id: set-matrix run: | php_versions="${{ steps.parse-php-versions.outputs.php_versions }}" - MATRIX_JSON=$(cat reusable-workflows/codeception-tests-configuration/matrix-config.json) - - IFS=',' read -ra VERSIONS_ARRAY <<< "$php_versions" - - FILTERED_MATRIX_JSON=$(echo $MATRIX_JSON | jq --arg php_versions "$php_versions" ' - { - matrix: [ - .configs[] | - select(.php_version == $php_versions) | - .matrix[] - ] - }') - - ENCODED_MATRIX_JSON=$(echo $FILTERED_MATRIX_JSON | jq -c .) - - echo "matrix=${ENCODED_MATRIX_JSON}" >> $GITHUB_OUTPUT + FILTERED_MATRIX_JSON=$(echo "$MATRIX_JSON" | jq --arg php_versions "$php_versions" '{ matrix: [ .configs[] | select(.php_version == $php_versions) | .matrix[] ] }') + ENCODED_MATRIX_JSON=$(echo "$FILTERED_MATRIX_JSON" | jq -c .) + echo "matrix=$ENCODED_MATRIX_JSON" >> "$GITHUB_OUTPUT" codeception-tests: needs: setup-matrix From 48ce09b83cd767549bece580c70793efe415b568 Mon Sep 17 00:00:00 2001 From: robertSt7 Date: Mon, 2 Feb 2026 13:19:11 +0000 Subject: [PATCH 8/8] Fix: Tests --- .github/workflows/elastic-search-codeception.yaml | 12 +++++++----- .github/workflows/open-search-codeception.yaml | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/elastic-search-codeception.yaml b/.github/workflows/elastic-search-codeception.yaml index 1b575592..47e713a8 100644 --- a/.github/workflows/elastic-search-codeception.yaml +++ b/.github/workflows/elastic-search-codeception.yaml @@ -70,7 +70,7 @@ jobs: with: APP_ENV: test PIMCORE_TEST: "1" - PRIVATE_REPO: "false" + PRIVATE_REPO: ${{ needs.setup-matrix.outputs.private_repo }} PHP_VERSION: ${{ matrix.matrix.php-version }} DATABASE: "mariadb:10.11" DEPENDENCIES: ${{ matrix.matrix.dependencies }} @@ -80,8 +80,10 @@ jobs: PIMCORE_ELASTIC_SEARCH_HOST: "39201" PIMCORE_ELASTIC_SEARCH_VERSION: "8.5.3" ENABLE_ELASTICSEARCH: true - COVERAGE: "xdebug" + COVERAGE: "none" secrets: - PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} - PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} - PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }} + SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER: ${{ secrets.SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER }} + COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }} + PIMCORE_CI_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} + PIMCORE_CI_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} + PIMCORE_CI_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }} diff --git a/.github/workflows/open-search-codeception.yaml b/.github/workflows/open-search-codeception.yaml index e3f6b6a1..144b3a5c 100644 --- a/.github/workflows/open-search-codeception.yaml +++ b/.github/workflows/open-search-codeception.yaml @@ -71,7 +71,7 @@ jobs: with: APP_ENV: test PIMCORE_TEST: "1" - PRIVATE_REPO: "false" + PRIVATE_REPO: ${{ needs.setup-matrix.outputs.private_repo }} PHP_VERSION: ${{ matrix.matrix.php-version }} DATABASE: "mariadb:10.11" DEPENDENCIES: ${{ matrix.matrix.dependencies }} @@ -81,8 +81,10 @@ jobs: PIMCORE_OPEN_SEARCH_HOST: "39200" PIMCORE_OPENSEARCH_VERSION: "2" ENABLE_ELASTICSEARCH: false - COVERAGE: "xdebug" + COVERAGE: "none" secrets: - PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} - PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} - PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }} + SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER: ${{ secrets.SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER }} + COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }} + PIMCORE_CI_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} + PIMCORE_CI_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} + PIMCORE_CI_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }}