ci.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. name: Continuous Integration
  2. on:
  3. - pull_request
  4. - push
  5. jobs:
  6. tests:
  7. strategy:
  8. matrix:
  9. operating-system:
  10. - ubuntu-latest
  11. php-version:
  12. - '7.0'
  13. - '7.1'
  14. - '7.2'
  15. - '7.3'
  16. - '7.4'
  17. include:
  18. - operating-system: 'ubuntu-latest'
  19. php-version: '8.0'
  20. composer-flags: '--ignore-platform-req=php'
  21. PHP_CS_FIXER_IGNORE_ENV: 1
  22. - operating-system: 'ubuntu-latest'
  23. php-version: '5.6'
  24. PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER: 1
  25. SYMFONY_DEPRECATIONS_HELPER: disabled
  26. - operating-system: 'windows-latest'
  27. php-version: '7.3'
  28. FAST_LINT_TEST_CASES: 1
  29. - operating-system: 'windows-latest'
  30. php-version: '5.6'
  31. SKIP_LINT_TEST_CASES: 1
  32. - operating-system: 'macos-latest'
  33. php-version: '7.4'
  34. PHP_CS_FIXER_FUTURE_MODE: 1
  35. name: PHP ${{ matrix.php-version }} CI on ${{ matrix.operating-system }} ${{ matrix.composer-flags }}
  36. runs-on: ${{ matrix.operating-system }}
  37. steps:
  38. - name: Checkout code
  39. uses: actions/checkout@v2
  40. - name: Setup PHP
  41. uses: shivammathur/setup-php@v2
  42. with:
  43. php-version: ${{ matrix.php-version }}
  44. - name: Get Composer cache directory
  45. id: composer-cache
  46. run: echo "::set-output name=dir::$(composer config cache-dir)"
  47. - name: Cache dependencies
  48. uses: actions/cache@v2
  49. with:
  50. path: ${{ steps.composer-cache.outputs.dir }}
  51. key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }}
  52. restore-keys: |
  53. composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-
  54. composer-${{ runner.os }}-${{ matrix.php-version }}-
  55. composer-${{ runner.os }}-
  56. composer-
  57. - name: Install dependencies
  58. uses: nick-invision/retry@v2
  59. with:
  60. timeout_minutes: 5
  61. max_attempts: 5
  62. retry_wait_seconds: 30
  63. command: |
  64. composer update --optimize-autoloader --no-interaction --no-progress ${{ matrix.composer-flags }}
  65. - name: Run tests
  66. continue-on-error: ${{ matrix.php-version == '8.0' }}
  67. env:
  68. PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }}
  69. FAST_LINT_TEST_CASES: ${{ matrix.FAST_LINT_TEST_CASES }}
  70. SKIP_LINT_TEST_CASES: ${{ matrix.SKIP_LINT_TEST_CASES }}
  71. PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER: ${{ matrix.PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER }}
  72. SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.SYMFONY_DEPRECATIONS_HELPER }}
  73. run: |
  74. vendor/bin/phpunit
  75. - name: Run PHP CS Fixer
  76. env:
  77. PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }}
  78. PHP_CS_FIXER_FUTURE_MODE: ${{ matrix.PHP_CS_FIXER_FUTURE_MODE }}
  79. run: |
  80. php php-cs-fixer --diff --dry-run -v fix