Skip to content

Add get similar document method #1991

Add get similar document method

Add get similar document method #1991

Workflow file for this run

name: Tests
on:
pull_request:
push:
# trying and staging branches are for BORS config
branches:
- trying
- staging
- main
- feature/**
jobs:
yaml-lint:
name: Yaml linting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Yaml lint check
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml
lint:
runs-on: ubuntu-latest
name: linter-check
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
- name: Install dependencies
run: composer update --prefer-dist --no-progress
- name: Run linter
run: composer lint
phpstan:
runs-on: ubuntu-latest
name: phpstan-tests
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
- name: Install dependencies
run: composer update --prefer-dist --no-progress
- name: Run types tests with PHPStan
run: composer phpstan
tests:
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
# Will still run for each push to bump-meilisearch-v*
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
runs-on: ubuntu-latest
services:
meilisearch:
image: getmeili/meilisearch:latest
ports:
- 7700:7700
env:
MEILI_MASTER_KEY: masterKey
MEILI_NO_ANALYTICS: true
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
name: integration-tests (PHP ${{ matrix.php-versions }})
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: |
composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction
composer update --prefer-dist --no-progress
- name: Run test suite - default HTTP client (Guzzle 7)
run: |
sh scripts/tests.sh --coverage-clover coverage-guzzle7.xml
composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
- name: Run test suite - php-http/guzzle7-adapter
run: |
composer require --dev php-http/guzzle7-adapter http-interop/http-factory-guzzle
sh scripts/tests.sh --coverage-clover coverage-guzzle7-adapter.xml
composer remove --dev php-http/guzzle7-adapter http-interop/http-factory-guzzle
- name: Run test suite - symfony/http-client
run: |
composer require --dev symfony/http-client nyholm/psr7
sh scripts/tests.sh --coverage-clover coverage-symfony-http-client.xml
composer remove --dev symfony/http-client nyholm/psr7
- name: Run test suite - php-http/curl-client
run: |
composer require --dev php-http/curl-client nyholm/psr7
sh scripts/tests.sh --coverage-clover coverage-nyholm-psr7.xml
composer remove --dev php-http/curl-client nyholm/psr7
- name: Run test suite - kriswallsmith/buzz
run: |
composer require --dev kriswallsmith/buzz nyholm/psr7 --with-all-dependencies
composer update php-http/client-common:2.6.0 php-http/httplug:2.3.0 psr/http-message
sh scripts/tests.sh --coverage-clover coverage-kriswallsmith-buzz.xml
composer remove --dev kriswallsmith/buzz nyholm/psr7
- name: Upload coverage file
uses: actions/upload-artifact@v4
with:
name: 'phpunit-${{ matrix.php-versions }}-coverage'
path: 'coverage*.xml'
test_php_7_guzzle_6:
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
# Will still run for each push to bump-meilisearch-v*
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
runs-on: ubuntu-latest
services:
meilisearch:
image: getmeili/meilisearch:latest
ports:
- 7700:7700
env:
MEILI_MASTER_KEY: masterKey
MEILI_NO_ANALYTICS: true
name: integration-tests (PHP 7.4 & Guzzle 6)
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: |
composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction
composer update --prefer-dist --no-progress
composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
composer update php-http/client-common:2.6.0 php-http/httplug:2.3.0 psr/http-message
- name: Run test suite - php-http/guzzle6-adapter
run: |
composer require --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
sh scripts/tests.sh
upload-coverage:
name: Upload coverage to Codecov
runs-on: ubuntu-latest
needs:
- tests
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Download coverage files
uses: actions/download-artifact@v4
with:
path: reports
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
directory: reports