ci.yml 2.3 KB

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