build.yaml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: Build
  2. on:
  3. pull_request: ~
  4. push: ~
  5. jobs:
  6. check:
  7. runs-on: ubuntu-20.04
  8. steps:
  9. - name: Checkout
  10. uses: actions/checkout@v2
  11. - name: Setup PHP
  12. uses: shivammathur/setup-php@v2
  13. - name: Validate composer.json
  14. run: composer validate --strict --no-check-lock
  15. cs-fixer:
  16. runs-on: ubuntu-20.04
  17. name: PHP-CS-Fixer
  18. steps:
  19. - name: Checkout
  20. uses: actions/checkout@v2
  21. - name: Setup PHP
  22. uses: shivammathur/setup-php@v2
  23. with:
  24. php-version: '7.3'
  25. - run: composer install --prefer-dist --no-interaction --no-progress --ansi
  26. - run: vendor/bin/php-cs-fixer fix --diff --dry-run --verbose
  27. tests:
  28. runs-on: ubuntu-20.04
  29. strategy:
  30. fail-fast: false
  31. matrix:
  32. include:
  33. - description: 'Symfony 6.0'
  34. php: '8.0'
  35. symfony: '6.0.*@dev'
  36. - description: 'Symfony 5.0'
  37. php: '7.3'
  38. symfony: '5.0.*'
  39. - description: 'Symfony 4.4'
  40. php: '7.1'
  41. symfony: '4.3.*@dev'
  42. - description: 'Symfony 3.4'
  43. php: '7.3'
  44. symfony: '3.4.*'
  45. - description: 'Beta deps'
  46. php: '7.2'
  47. beta: true
  48. name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
  49. steps:
  50. - name: Checkout
  51. uses: actions/checkout@v2
  52. - name: Cache
  53. uses: actions/cache@v2
  54. with:
  55. path: ~/.composer/cache/files
  56. key: composer-${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }}
  57. - name: Setup PHP
  58. uses: shivammathur/setup-php@v2
  59. with:
  60. php-version: ${{ matrix.php }}
  61. - run: |
  62. sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json;
  63. if: matrix.symfony
  64. - run: |
  65. composer config minimum-stability dev
  66. composer config prefer-stable true
  67. if: matrix.beta
  68. - name: remove cs-fixer for Symfony 6
  69. if: contains(matrix.symfony, '6.0.*@dev')
  70. run: |
  71. composer remove --dev friendsofphp/php-cs-fixer pedrotroller/php-cs-custom-fixer --no-update
  72. - run: composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_option }}
  73. - run: vendor/bin/phpunit
  74. - run: vendor/bin/phpstan analyse --ansi --no-progress