ci.yml 2.7 KB

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