diff --git a/.editorconfig b/.editorconfig index c75f6f9..49bcd3e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,7 +12,7 @@ indent_size = 4 max_line_length = 120 [*.{yml,yaml}] -indent_size = 4 +indent_size = 2 [*.json] indent_size = 2 diff --git a/.github/scripts/get-latest-meilisearch-rc.sh b/.github/scripts/get-latest-meilisearch-rc.sh new file mode 100644 index 0000000..af6b47e --- /dev/null +++ b/.github/scripts/get-latest-meilisearch-rc.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# This script is used in the SDK CIs to fetch the latest Meilisearch RC name (ex: v0.16.0rc2). +# The Meilisearch RC is needed when maintainers are developing features during the pre-release week because the final Meilisearch release is not out yet. + +temp_file='temp_file' # temp_file needed because `grep` would start before the download is over +curl -s 'https://api.github.com/repos/meilisearch/meilisearch/releases' > "$temp_file" +latest_rc_release=$(cat "$temp_file" \ + | grep -E 'tag_name' | grep 'rc' | head -1 \ + | tr -d ',"' | cut -d ':' -f2 | tr -d ' ') +rm -rf "$temp_file" +echo "$latest_rc_release" diff --git a/.github/workflows/pre-release-tests.yml b/.github/workflows/pre-release-tests.yml index 57f6430..9eb0cbb 100644 --- a/.github/workflows/pre-release-tests.yml +++ b/.github/workflows/pre-release-tests.yml @@ -11,25 +11,80 @@ on: - bump-meilisearch-v* jobs: + meilisearch-version: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Grep docker latest rc version of Meilisearch + id: grep-step + run: | + MEILISEARCH_VERSION=$(sh .github/scripts/get-latest-meilisearch-rc.sh) + echo $MEILISEARCH_VERSION + echo "version=$MEILISEARCH_VERSION" >> $GITHUB_OUTPUT + outputs: + version: ${{ steps.grep-step.outputs.version }} + integration-tests: runs-on: ubuntu-latest + needs: ['meilisearch-version'] + services: + meilisearch: + image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }} + ports: + - '7700:7700' + env: + MEILI_MASTER_KEY: masterKey + MEILI_NO_ANALYTICS: true strategy: matrix: - php-versions: ['7.4', '8.0'] - name: integration-tests-against-rc (PHP ${{ matrix.php-versions }}) + php-version: ['7.4', '8.1', '8.2', '8.3'] + sf-version: ['5.4', '6.4', '7.0', '7.1'] + exclude: + - php-version: '7.4' + sf-version: '6.4' + - php-version: '7.4' + sf-version: '7.0' + - php-version: '7.4' + sf-version: '7.1' + - php-version: '8.1' + sf-version: '5.4' + - php-version: '8.1' + sf-version: '7.0' + - php-version: '8.1' + sf-version: '7.1' + - php-version: '8.2' + sf-version: '5.4' + - php-version: '8.3' + sf-version: '5.4' + - php-version: '8.3' + sf-version: '5.4' + + name: integration-tests-against-rc (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }}.*) steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + - name: Install PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-versions }} + php-version: ${{ matrix.php-version }} + tools: composer, flex + - name: Validate composer.json and composer.lock run: composer validate + + - name: Remove doctrine/annotations + if: matrix.php-version != '7.4' + run: sed -i '/doctrine\/annotations/d' composer.json + - name: Install dependencies - run: composer install --prefer-dist --no-progress --quiet - - name: Get the latest Meilisearch RC - run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV - - name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker - run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics + uses: ramsey/composer-install@v3 + env: + SYMFONY_REQUIRE: ${{ matrix.sf-version }}.* + with: + dependency-versions: 'highest' + - name: Run test suite - run: composer test:unit + run: composer test:unit -- --coverage-clover coverage.xml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 528a5b6..89c186b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: meilisearch: image: getmeili/meilisearch:latest ports: - - 7700:7700 + - '7700:7700' env: MEILI_MASTER_KEY: masterKey MEILI_NO_ANALYTICS: true diff --git a/src/MeilisearchBundle.php b/src/MeilisearchBundle.php index 88c2915..4ae1f98 100644 --- a/src/MeilisearchBundle.php +++ b/src/MeilisearchBundle.php @@ -8,7 +8,7 @@ final class MeilisearchBundle extends Bundle { - public const VERSION = '0.15.3'; + public const VERSION = '0.15.4'; public static function qualifiedVersion(): string {