tests.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: tests
  2. on:
  3. pull_request:
  4. push:
  5. branches: [ main ]
  6. permissions:
  7. contents: read
  8. jobs:
  9. tests:
  10. services:
  11. ydb:
  12. image: cr.yandex/yc/yandex-docker-local-ydb:${{ matrix.ydb-versions }}
  13. ports:
  14. - 2135:2135
  15. - 2136:2136
  16. - 8765:8765
  17. volumes:
  18. - /tmp/ydb_certs:/ydb_certs
  19. env:
  20. YDB_USE_IN_MEMORY_PDISKS: true
  21. options: '-h localhost'
  22. runs-on: ubuntu-latest
  23. strategy:
  24. fail-fast: false
  25. matrix:
  26. php-versions: [ '7.2', '7.4', '8.0', '8.2' ]
  27. ydb-versions: ['stable-22-5', 'trunk', '23.3', '23.2', '23.1']
  28. steps:
  29. - uses: actions/checkout@v3
  30. name: Checkout
  31. - uses: eWaterCycle/setup-grpc@v5
  32. name: Setup gRPC
  33. with:
  34. grpc-version: 1.51.1
  35. - uses: shivammathur/setup-php@v2
  36. name: Setup PHP
  37. id: php
  38. with:
  39. extensions: grpc
  40. php-version: ${{ matrix.php-versions }}
  41. - run: composer validate --strict
  42. name: Validate composer.json and composer.lock
  43. - uses: actions/cache@v3
  44. name: Cache Composer packages
  45. id: composer-cache
  46. with:
  47. path: vendor
  48. key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
  49. restore-keys: |
  50. ${{ runner.os }}-php-
  51. - name: Install dependencies
  52. run: composer install --prefer-dist --no-progress
  53. - name: Create YDB User
  54. run: docker exec $(docker ps --latest --quiet) /ydb -e grpc://localhost:2136 -d /local scripting yql -s "CREATE USER testuser PASSWORD 'test_password'"
  55. - name: Run tests
  56. run: ./vendor/bin/phpunit \
  57. --coverage-text \
  58. --whitelist src \
  59. --testdox \
  60. tests