ci.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
  2. on:
  3. - "pull_request"
  4. - "push"
  5. name: "CI"
  6. env:
  7. # - COMPOSER_ROOT_VERSION is needed to get round the recursive dependency when using CI.
  8. COMPOSER_ROOT_VERSION: '4.99.99'
  9. jobs:
  10. coding-guidelines:
  11. name: "Coding Guidelines"
  12. runs-on: "ubuntu-latest"
  13. steps:
  14. - name: "Checkout"
  15. uses: "actions/checkout@v3"
  16. - name: "Run friendsofphp/php-cs-fixer"
  17. run: "php7.4 ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose"
  18. type-checker:
  19. name: "Type Checker"
  20. runs-on: "ubuntu-latest"
  21. steps:
  22. - name: "Checkout"
  23. uses: "actions/checkout@v3"
  24. - name: "Update dependencies with composer"
  25. run: "php7.4 ./tools/composer update --no-ansi --no-interaction --no-progress"
  26. - name: "Run vimeo/psalm"
  27. run: "php7.4 ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats"
  28. tests:
  29. name: "Tests"
  30. runs-on: "ubuntu-latest"
  31. strategy:
  32. fail-fast: false
  33. matrix:
  34. php-version:
  35. - "7.3"
  36. - "7.4"
  37. - "8.0"
  38. - "8.1"
  39. steps:
  40. - name: "Checkout"
  41. uses: "actions/checkout@v3"
  42. - name: "Install PHP with extensions"
  43. uses: "shivammathur/setup-php@v2"
  44. with:
  45. php-version: "${{ matrix.php-version }}"
  46. coverage: "pcov"
  47. - name: "Cache dependencies installed with composer"
  48. uses: "actions/cache@v2"
  49. with:
  50. path: "~/.composer/cache"
  51. key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
  52. restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
  53. - name: "Install dependencies with composer"
  54. run: "./tools/composer update --no-ansi --no-interaction --no-progress"
  55. - name: "Run tests with phpunit/phpunit"
  56. run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
  57. - name: "Send code coverage report to Codecov.io"
  58. env:
  59. CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
  60. run: "bash <(curl -s https://codecov.io/bash) || true"