tests.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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-16.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.0"
  70. - "7.1"
  71. - "7.2"
  72. - "7.3"
  73. - "7.4"
  74. - "8.0"
  75. mongodb-version:
  76. - "4.4"
  77. driver-version:
  78. - "stable"
  79. deps:
  80. - "normal"
  81. include:
  82. - deps: "low"
  83. os: "ubuntu-16.04"
  84. php-version: "5.6"
  85. mongodb-version: "3.0"
  86. driver-version: "1.2.0"
  87. steps:
  88. - name: "Checkout"
  89. uses: "actions/checkout@v2"
  90. with:
  91. fetch-depth: 2
  92. - name: Setup cache environment
  93. id: extcache
  94. uses: shivammathur/cache-extensions@v1
  95. with:
  96. php-version: ${{ matrix.php-version }}
  97. extensions: "mongodb-${{ matrix.driver-version }}"
  98. key: "extcache-v1"
  99. - name: Cache extensions
  100. uses: actions/cache@v2
  101. with:
  102. path: ${{ steps.extcache.outputs.dir }}
  103. key: ${{ steps.extcache.outputs.key }}
  104. restore-keys: ${{ steps.extcache.outputs.key }}
  105. - name: "Install PHP"
  106. uses: "shivammathur/setup-php@v2"
  107. with:
  108. php-version: "${{ matrix.php-version }}"
  109. tools: "pecl"
  110. extensions: "mongodb-${{ matrix.driver-version }}"
  111. coverage: "none"
  112. ini-values: "zend.assertions=1"
  113. - name: "Show driver information"
  114. run: "php --ri mongodb"
  115. - name: "Cache dependencies installed with composer"
  116. uses: "actions/cache@v2"
  117. with:
  118. path: "~/.composer/cache"
  119. key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.json') }}"
  120. restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.deps }}-"
  121. - name: "Install dependencies with composer"
  122. run: "composer update --no-interaction --no-progress"
  123. if: "${{ matrix.deps == 'normal' }}"
  124. - name: "Install lowest possible dependencies with composer"
  125. run: "composer update --no-interaction --no-progress --prefer-dist --prefer-lowest"
  126. if: "${{ matrix.deps == 'low' }}"
  127. - id: setup-mongodb
  128. uses: mongodb-labs/drivers-evergreen-tools@master
  129. with:
  130. version: ${{ matrix.mongodb-version }}
  131. - name: "Run PHPUnit"
  132. run: "vendor/bin/simple-phpunit -v"
  133. env:
  134. SYMFONY_DEPRECATIONS_HELPER: 999999
  135. MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}