tests.yml 4.7 KB

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