| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- name: Tests
- on:
- pull_request:
- push:
- # trying and staging branches are for BORS config
- branches:
- - trying
- - staging
- - main
- jobs:
- lint:
- runs-on: ubuntu-latest
- name: linter-check
- steps:
- - uses: actions/checkout@v1
- - name: Install PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: 7.4
- - name: Install dependencies
- run: composer update --prefer-dist --no-progress
- - name: Run linter
- run: vendor/bin/php-cs-fixer fix -v --config=.php_cs.dist --using-cache=no --dry-run --allow-risky=yes
- 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
- strategy:
- matrix:
- php-versions: ['7.2', '7.3', '7.4', '8.0']
- name: integration-tests (PHP ${{ matrix.php-versions }})
- steps:
- - uses: actions/checkout@v1
- - name: Install PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php-versions }}
- - 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: MeiliSearch (latest version) setup with Docker
- run: docker run -d -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
- - name: Run test suite - default HTTP client (Guzzle 7)
- run: |
- sh scripts/tests.sh
- composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
- - name: Run test suite - php-http/guzzle6-adapter
- # Don't run on PHP 8
- # Guzzle 6 is not compatible with PHP 8.0
- if: ${{ !startsWith(matrix.php-versions, '8.') }}
- run: |
- composer require --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
- sh scripts/tests.sh
- composer remove --dev php-http/guzzle6-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
- composer remove --dev symfony/http-client nyholm/psr7
- - name: Run test suite - php-http/curl-client
- # Don't run on PHP 8
- # php-http/curl-client is currently not compatible with PHP 8.0
- if: ${{ !startsWith(matrix.php-versions, '8.') }}
- run: |
- composer require --dev php-http/curl-client nyholm/psr7
- sh scripts/tests.sh
- composer remove --dev php-http/curl-client nyholm/psr7
- - name: Run test suite - kriswallsmith/buzz
- # Don't run on PHP 8
- # kriswallsmith/buzz is currently not compatible with PHP 8.0
- if: ${{ !startsWith(matrix.php-versions, '8.') }}
- run: |
- composer require --dev kriswallsmith/buzz nyholm/psr7
- sh scripts/tests.sh
- composer remove --dev kriswallsmith/buzz nyholm/psr7
|