tests.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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:stable-22-5
  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. matrix:
  25. php-versions: [ '7.2' ]
  26. steps:
  27. - uses: actions/checkout@v3
  28. name: Checkout
  29. - uses: eWaterCycle/setup-grpc@v5
  30. name: Setup gRPC
  31. with:
  32. grpc-version: 1.51.1
  33. - uses: shivammathur/setup-php@v2
  34. name: Setup PHP
  35. id: php
  36. with:
  37. extensions: grpc
  38. php-version: ${{ matrix.php-versions }}
  39. - run: composer validate --strict
  40. name: Validate composer.json and composer.lock
  41. - uses: actions/cache@v3
  42. name: Cache Composer packages
  43. id: composer-cache
  44. with:
  45. path: vendor
  46. key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
  47. restore-keys: |
  48. ${{ runner.os }}-php-
  49. - name: Install dependencies
  50. run: composer install --prefer-dist --no-progress
  51. - name: Create YDB User
  52. run: docker exec $(docker ps --latest --quiet) /ydb -e grpc://localhost:2136 -d /local scripting yql -s "CREATE USER testuser PASSWORD 'test_password'"
  53. - name: Run tests
  54. run: ./vendor/bin/phpunit \
  55. --coverage-text \
  56. --whitelist src \
  57. --testdox \
  58. tests