ci.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: "CI"
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - 'main'
  7. env:
  8. SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit"
  9. jobs:
  10. tests:
  11. name: "PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }}"
  12. runs-on: ubuntu-latest
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. php-version:
  17. - '7.1'
  18. - '7.2'
  19. - '7.3'
  20. - '7.4'
  21. - '8.0'
  22. dependencies:
  23. - 'highest'
  24. include:
  25. - php-version: '7.1'
  26. dependencies: 'lowest'
  27. steps:
  28. - name: "Checkout code"
  29. uses: actions/checkout@v2.3.3
  30. - name: "Install PHP with extensions"
  31. uses: shivammathur/setup-php@2.7.0
  32. with:
  33. coverage: "none"
  34. php-version: ${{ matrix.php-version }}
  35. tools: composer:v2
  36. - name: "Validate composer.json"
  37. run: "composer validate --strict --no-check-lock"
  38. - name: "Add PHPUnit matcher"
  39. run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
  40. - run: composer require --no-update composer/composer:^1.0.2
  41. - uses: "ramsey/composer-install@v1"
  42. with:
  43. dependency-versions: "${{ matrix.dependencies }}"
  44. - name: "Install PHPUnit"
  45. run: vendor/bin/simple-phpunit install
  46. - name: "PHPUnit version"
  47. run: vendor/bin/simple-phpunit --version
  48. - run: vendor/bin/simple-phpunit
  49. - run: composer require --no-update composer/composer:^2
  50. - uses: "ramsey/composer-install@v1"
  51. with:
  52. dependency-versions: "${{ matrix.dependencies }}"
  53. - run: vendor/bin/simple-phpunit
  54. - if: matrix.php-version == '7.1'
  55. name: "Lint PHP files"
  56. run: find src/ -name '*.php' | xargs -n1 php -l