No Description

ci.yaml 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. name: "Continuous Integration"
  2. on:
  3. - pull_request
  4. - push
  5. env:
  6. COMPOSER_ROOT_VERSION: 1.99
  7. jobs:
  8. composer-json-lint:
  9. name: "Lint composer.json"
  10. runs-on: "ubuntu-latest"
  11. strategy:
  12. matrix:
  13. php-version:
  14. - "8.1"
  15. steps:
  16. - name: "Checkout"
  17. uses: "actions/checkout@v2"
  18. - name: "Install PHP"
  19. uses: "shivammathur/setup-php@v2"
  20. with:
  21. coverage: "none"
  22. php-version: "${{ matrix.php-version }}"
  23. tools: composer-normalize
  24. - name: "Get composer cache directory"
  25. id: composercache
  26. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  27. - name: "Cache dependencies"
  28. uses: actions/cache@v2
  29. with:
  30. path: ${{ steps.composercache.outputs.dir }}
  31. key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
  32. restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
  33. - name: "Install dependencies"
  34. run: "composer update --no-interaction --no-progress"
  35. - name: "Validate composer.json"
  36. run: "composer validate --strict"
  37. - name: "Normalize composer.json"
  38. run: "composer-normalize --dry-run"
  39. tests:
  40. name: "Tests"
  41. runs-on: "ubuntu-latest"
  42. strategy:
  43. matrix:
  44. php-version:
  45. - "7.1"
  46. - "7.2"
  47. - "7.3"
  48. - "7.4"
  49. - "8.0"
  50. - "8.1"
  51. dependencies:
  52. - "lowest"
  53. - "highest"
  54. steps:
  55. - name: "Checkout"
  56. uses: "actions/checkout@v2"
  57. - name: "Install PHP"
  58. uses: "shivammathur/setup-php@v2"
  59. with:
  60. php-version: "${{ matrix.php-version }}"
  61. ini-values: zend.assertions=1
  62. - name: "Get composer cache directory"
  63. id: composercache
  64. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  65. - name: "Cache dependencies"
  66. uses: actions/cache@v2
  67. with:
  68. path: ${{ steps.composercache.outputs.dir }}
  69. key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
  70. restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
  71. - name: "Install lowest dependencies"
  72. if: ${{ matrix.dependencies == 'lowest' }}
  73. run: "composer update --no-interaction --no-progress --prefer-lowest"
  74. - name: "Install highest dependencies"
  75. if: ${{ matrix.dependencies == 'highest' }}
  76. run: "composer update --no-interaction --no-progress"
  77. - name: "Run tests"
  78. timeout-minutes: 3
  79. run: "vendor/bin/phpunit"