From 3c8d25dcb6041b7ef5d0ce05a1eb6728d2b2434f Mon Sep 17 00:00:00 2001 From: darthf1 <17253332+darthf1@users.noreply.github.com> Date: Wed, 28 May 2025 16:02:05 +0200 Subject: [PATCH] feat(elasticsearch): add support for v9 --- .github/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++-- composer.json | 2 +- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43d914fff2d..1354683291c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -749,8 +749,60 @@ jobs: php-coveralls --coverage_clover=build/logs/behat/clover.xml continue-on-error: true - elasticsearch: - name: Behat (PHP ${{ matrix.php }}) (Elasticsearch) + elasticsearch-v9: + name: Behat (PHP ${{ matrix.php }}) (Elasticsearch v9) + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + php: + - '8.4' + fail-fast: false + env: + APP_ENV: elasticsearch + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Configure sysctl limits + run: | + sudo swapoff -a + sudo sysctl -w vm.swappiness=1 + sudo sysctl -w fs.file-max=262144 + sudo sysctl -w vm.max_map_count=262144 + - name: Runs Elasticsearch + uses: elastic/elastic-github-actions/elasticsearch@master + with: + stack-version: '9.0.0' + security-enabled: false + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: pecl, composer + extensions: intl, bcmath, curl, openssl, mbstring, mongodb + coverage: none + ini-values: memory_limit=-1 + - name: Get composer cache directory + id: composercache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + - name: Update project dependencies + run: | + composer global require soyuka/pmu + composer global config allow-plugins.soyuka/pmu true --no-interaction + composer global link . + - name: Clear test app cache + run: tests/Fixtures/app/console cache:clear --ansi + - name: Run Behat tests + run: vendor/bin/behat --out=std --format=progress --profile=elasticsearch --no-interaction + + elasticsearch-v8: + name: Behat (PHP ${{ matrix.php }}) (Elasticsearch v8) runs-on: ubuntu-latest timeout-minutes: 20 strategy: @@ -796,6 +848,7 @@ jobs: composer global require soyuka/pmu composer global config allow-plugins.soyuka/pmu true --no-interaction composer global link . + composer require elasticsearch/elasticsearch "^8.4" -W - name: Clear test app cache run: tests/Fixtures/app/console cache:clear --ansi - name: Run Behat tests diff --git a/composer.json b/composer.json index 4480f7ece51..a9998207b77 100644 --- a/composer.json +++ b/composer.json @@ -128,7 +128,7 @@ "doctrine/mongodb-odm": "^2.10", "doctrine/mongodb-odm-bundle": "^5.0", "doctrine/orm": "^2.17 || ^3.0", - "elasticsearch/elasticsearch": "^7.17 || ^8.4", + "elasticsearch/elasticsearch": "^7.17 || ^8.4 || ^9.0", "friends-of-behat/mink-browserkit-driver": "^1.3.1", "friends-of-behat/mink-extension": "^2.2", "friends-of-behat/symfony-extension": "^2.1",