ci.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. tests:
  42. name: "Tests"
  43. runs-on: "ubuntu-latest"
  44. strategy:
  45. fail-fast: false
  46. matrix:
  47. php-version:
  48. - "7.3"
  49. - "7.4"
  50. - "8.0"
  51. - "8.1"
  52. steps:
  53. - name: "Checkout"
  54. uses: "actions/checkout@v2"
  55. - name: "Install PHP with extensions"
  56. uses: "shivammathur/setup-php@v2"
  57. with:
  58. php-version: "${{ matrix.php-version }}"
  59. coverage: "pcov"
  60. - name: "Cache dependencies installed with composer"
  61. uses: "actions/cache@v1"
  62. with:
  63. path: "~/.composer/cache"
  64. key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
  65. restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
  66. - name: "Install dependencies with composer"
  67. run: "./tools/composer update --no-ansi --no-interaction --no-progress"
  68. - name: "Run tests with phpunit/phpunit"
  69. run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
  70. - name: "Send code coverage report to Codecov.io"
  71. env:
  72. CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
  73. run: "bash <(curl -s https://codecov.io/bash) || true"
  74. mutation-tests:
  75. name: "Mutation Tests"
  76. runs-on: "ubuntu-latest"
  77. strategy:
  78. matrix:
  79. php-version:
  80. - "7.4"
  81. steps:
  82. - name: "Checkout"
  83. uses: "actions/checkout@v2"
  84. - name: "Install PHP with extensions"
  85. uses: "shivammathur/setup-php@v2"
  86. with:
  87. php-version: "${{ matrix.php-version }}"
  88. coverage: "pcov"
  89. - name: "Cache dependencies installed with composer"
  90. uses: "actions/cache@v1"
  91. with:
  92. path: "~/.composer/cache"
  93. key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
  94. restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
  95. - name: "Install dependencies with composer"
  96. run: "./tools/composer update --no-ansi --no-interaction --no-progress"
  97. - name: "Run mutation tests with infection/infection"
  98. run: "./tools/infection --show-mutations --only-covered"