tests.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. name: "Tests"
  2. on:
  3. pull_request:
  4. branches:
  5. - "*.x"
  6. push:
  7. branches:
  8. - "*.x"
  9. jobs:
  10. verification:
  11. name: "Verification tests"
  12. runs-on: "ubuntu-18.04"
  13. steps:
  14. - name: "Checkout"
  15. uses: "actions/checkout@v2"
  16. with:
  17. fetch-depth: 2
  18. - name: Setup cache environment
  19. id: extcache
  20. uses: shivammathur/cache-extensions@v1
  21. with:
  22. php-version: "5.6"
  23. extensions: "mongodb-1.7.5, mongo-1.6.14"
  24. key: "extcache-v1"
  25. - name: Cache extensions
  26. uses: actions/cache@v2
  27. with:
  28. path: ${{ steps.extcache.outputs.dir }}
  29. key: ${{ steps.extcache.outputs.key }}
  30. restore-keys: ${{ steps.extcache.outputs.key }}
  31. - name: "Install PHP"
  32. uses: "shivammathur/setup-php@v2"
  33. with:
  34. php-version: "5.6"
  35. tools: "pecl"
  36. extensions: "mongodb-1.7.5, mongo-1.6.14"
  37. coverage: "none"
  38. ini-values: "zend.assertions=1"
  39. - name: "Show legacy driver information"
  40. run: "php --ri mongo"
  41. - name: "Show driver information"
  42. run: "php --ri mongodb"
  43. - name: "Cache dependencies installed with composer"
  44. uses: "actions/cache@v2"
  45. with:
  46. path: "~/.composer/cache"
  47. key: "php-5.6-composer-locked-${{ hashFiles('composer.json') }}"
  48. restore-keys: "php-5.6-composer-normal-"
  49. - name: "Install dependencies with composer"
  50. run: "composer update --no-interaction --no-progress"
  51. - id: setup-mongodb
  52. uses: mongodb-labs/drivers-evergreen-tools@master
  53. with:
  54. version: "3.0"
  55. - name: "Run PHPUnit"
  56. run: "vendor/bin/simple-phpunit -v"
  57. env:
  58. SYMFONY_DEPRECATIONS_HELPER: 999999
  59. MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}
  60. phpunit:
  61. name: "PHPUnit tests"
  62. runs-on: "${{ matrix.os }}"
  63. strategy:
  64. fail-fast: true
  65. matrix:
  66. os:
  67. - "ubuntu-18.04"
  68. php-version:
  69. - "7.2"
  70. - "7.3"
  71. - "7.4"
  72. - "8.0"
  73. - "8.1"
  74. mongodb-version:
  75. - "4.4"
  76. driver-version:
  77. - "stable"
  78. deps:
  79. - "normal"
  80. include:
  81. - deps: "low"
  82. os: "ubuntu-18.04"
  83. php-version: "5.6"
  84. mongodb-version: "3.0"
  85. driver-version: "1.2.0"
  86. - deps: "normal"
  87. os: "ubuntu-18.04"
  88. php-version: "7.0"
  89. mongodb-version: "4.4"
  90. driver-version: "1.9.2"
  91. - deps: "normal"
  92. os: "ubuntu-18.04"
  93. php-version: "7.1"
  94. mongodb-version: "4.4"
  95. driver-version: "1.11.1"
  96. steps:
  97. - name: "Checkout"
  98. uses: "actions/checkout@v2"
  99. with:
  100. fetch-depth: 2
  101. - name: Setup cache environment
  102. id: extcache
  103. uses: shivammathur/cache-extensions@v1
  104. with:
  105. php-version: ${{ matrix.php-version }}
  106. extensions: "mongodb-${{ matrix.driver-version }}"
  107. key: "extcache-v1"
  108. - name: Cache extensions
  109. uses: actions/cache@v2
  110. with:
  111. path: ${{ steps.extcache.outputs.dir }}
  112. key: ${{ steps.extcache.outputs.key }}
  113. restore-keys: ${{ steps.extcache.outputs.key }}
  114. - name: "Install PHP"
  115. uses: "shivammathur/setup-php@v2"
  116. with:
  117. php-version: "${{ matrix.php-version }}"
  118. tools: "pecl"
  119. extensions: "mongodb-${{ matrix.driver-version }}"
  120. coverage: "none"
  121. ini-values: "zend.assertions=1"
  122. - name: "Show driver information"
  123. run: "php --ri mongodb"
  124. - name: "Cache dependencies installed with composer"
  125. uses: "actions/cache@v2"
  126. with:
  127. path: "~/.composer/cache"
  128. key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.json') }}"
  129. restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.deps }}-"
  130. - name: "Install dependencies with composer"
  131. run: "composer update --no-interaction --no-progress"
  132. if: "${{ matrix.deps == 'normal' }}"
  133. - name: "Install lowest possible dependencies with composer"
  134. run: "composer update --no-interaction --no-progress --prefer-dist --prefer-lowest"
  135. if: "${{ matrix.deps == 'low' }}"
  136. - id: setup-mongodb
  137. uses: mongodb-labs/drivers-evergreen-tools@master
  138. with:
  139. version: ${{ matrix.mongodb-version }}
  140. - name: "Run PHPUnit"
  141. run: "vendor/bin/simple-phpunit -v"
  142. env:
  143. SYMFONY_DEPRECATIONS_HELPER: 999999
  144. MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}