continuous-integration.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: "Continuous Integration"
  2. on:
  3. - push
  4. - pull_request
  5. env:
  6. COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
  7. jobs:
  8. tests:
  9. name: "CI"
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. php-version:
  14. - "5.3"
  15. - "5.4"
  16. - "5.5"
  17. - "5.6"
  18. - "7.0"
  19. - "7.1"
  20. - "7.2"
  21. - "7.3"
  22. - "7.4"
  23. # disabled for monolog 1.x as not worth the trouble, people should use monolog 2 anyway
  24. # - "8.0"
  25. # disabled for now as it leads to PHPUnit installing in a very old 4.3 version due to phpspec/prophecy not allowing 8.1
  26. # - "8.1"
  27. steps:
  28. - name: "Checkout"
  29. uses: "actions/checkout@v2"
  30. - name: "Install PHP 5"
  31. if: "startsWith(matrix.php-version, '5.')"
  32. uses: "shivammathur/setup-php@v2"
  33. with:
  34. coverage: "none"
  35. php-version: "${{ matrix.php-version }}"
  36. extensions: "mongo"
  37. - name: "Install PHP 7+"
  38. if: "!startsWith(matrix.php-version, '5.')"
  39. uses: "shivammathur/setup-php@v2"
  40. with:
  41. coverage: "none"
  42. php-version: "${{ matrix.php-version }}"
  43. - name: Get composer cache directory
  44. id: composercache
  45. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  46. - name: Cache dependencies
  47. uses: actions/cache@v2
  48. with:
  49. path: ${{ steps.composercache.outputs.dir }}
  50. key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
  51. restore-keys: ${{ runner.os }}-composer-
  52. - name: "Install latest dependencies"
  53. run: |
  54. # Remove PHPStan as it requires a newer PHP
  55. composer remove phpstan/phpstan --dev --no-update
  56. composer update ${{ env.COMPOSER_FLAGS }}
  57. - name: "Run tests"
  58. run: "composer test"