ci.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.3 ./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.3 ./tools/composer update --no-ansi --no-interaction --no-progress"
  23. - name: "Run vimeo/psalm"
  24. run: "php7.3 ./tools/psalm --config=psalm.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=3.0.0
  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. steps:
  54. - name: "Checkout"
  55. uses: "actions/checkout@v2"
  56. - name: "Install PHP with extensions"
  57. uses: "shivammathur/setup-php@v1"
  58. with:
  59. php-version: "${{ matrix.php-version }}"
  60. coverage: "pcov"
  61. - name: "Cache dependencies installed with composer"
  62. uses: "actions/cache@v1"
  63. with:
  64. path: "~/.composer/cache"
  65. key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
  66. restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
  67. - name: "Install dependencies with composer"
  68. run: "./tools/composer update --no-ansi --no-interaction --no-progress"
  69. - name: "Run tests with phpunit/phpunit"
  70. run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
  71. - name: "Send code coverage report to Codecov.io"
  72. env:
  73. CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
  74. run: "bash <(curl -s https://codecov.io/bash) || true"