ci.yaml 3.1 KB

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