tests.yml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: Tests
  2. on:
  3. pull_request:
  4. push:
  5. # trying and staging branches are for BORS config
  6. branches:
  7. - trying
  8. - staging
  9. - main
  10. jobs:
  11. lint:
  12. runs-on: ubuntu-latest
  13. name: linter-check
  14. steps:
  15. - uses: actions/checkout@v1
  16. - name: Install PHP
  17. uses: shivammathur/setup-php@v2
  18. with:
  19. php-version: 7.4
  20. - name: Install dependencies
  21. run: composer update --prefer-dist --no-progress
  22. - name: Run linter
  23. run: vendor/bin/php-cs-fixer fix -v --config=.php_cs.dist --using-cache=no --dry-run --allow-risky=yes
  24. tests:
  25. # Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
  26. # Will still run for each push to bump-meilisearch-v*
  27. if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
  28. runs-on: ubuntu-latest
  29. strategy:
  30. matrix:
  31. php-versions: ['7.2', '7.3', '7.4', '8.0']
  32. name: integration-tests (PHP ${{ matrix.php-versions }})
  33. steps:
  34. - uses: actions/checkout@v1
  35. - name: Install PHP
  36. uses: shivammathur/setup-php@v2
  37. with:
  38. php-version: ${{ matrix.php-versions }}
  39. - name: Validate composer.json and composer.lock
  40. run: composer validate
  41. - name: Install dependencies
  42. run: |
  43. composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction
  44. composer update --prefer-dist --no-progress
  45. - name: MeiliSearch (latest version) setup with Docker
  46. run: docker run -d -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
  47. - name: Run test suite - default HTTP client (Guzzle 7)
  48. run: |
  49. sh scripts/tests.sh
  50. composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
  51. - name: Run test suite - php-http/guzzle6-adapter
  52. # Don't run on PHP 8
  53. # Guzzle 6 is not compatible with PHP 8.0
  54. if: ${{ !startsWith(matrix.php-versions, '8.') }}
  55. run: |
  56. composer require --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
  57. sh scripts/tests.sh
  58. composer remove --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
  59. - name: Run test suite - symfony/http-client
  60. run: |
  61. composer require --dev symfony/http-client nyholm/psr7
  62. sh scripts/tests.sh
  63. composer remove --dev symfony/http-client nyholm/psr7
  64. - name: Run test suite - php-http/curl-client
  65. # Don't run on PHP 8
  66. # php-http/curl-client is currently not compatible with PHP 8.0
  67. if: ${{ !startsWith(matrix.php-versions, '8.') }}
  68. run: |
  69. composer require --dev php-http/curl-client nyholm/psr7
  70. sh scripts/tests.sh
  71. composer remove --dev php-http/curl-client nyholm/psr7
  72. - name: Run test suite - kriswallsmith/buzz
  73. # Don't run on PHP 8
  74. # kriswallsmith/buzz is currently not compatible with PHP 8.0
  75. if: ${{ !startsWith(matrix.php-versions, '8.') }}
  76. run: |
  77. composer require --dev kriswallsmith/buzz nyholm/psr7
  78. sh scripts/tests.sh
  79. composer remove --dev kriswallsmith/buzz nyholm/psr7