continuous-integration.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: "Continuous Integration"
  2. on:
  3. pull_request:
  4. branches:
  5. - "*.x"
  6. push:
  7. branches:
  8. - "*.x"
  9. env:
  10. fail-fast: true
  11. COMPOSER_ROOT_VERSION: "1.4"
  12. jobs:
  13. phpunit:
  14. name: "PHPUnit with SQLite"
  15. runs-on: "ubuntu-20.04"
  16. strategy:
  17. matrix:
  18. php-version:
  19. - "7.1"
  20. - "7.2"
  21. - "7.3"
  22. - "7.4"
  23. - "8.0"
  24. steps:
  25. - name: "Checkout"
  26. uses: "actions/checkout@v2"
  27. with:
  28. fetch-depth: 2
  29. - name: "Install PHP with XDebug"
  30. uses: "shivammathur/setup-php@v2"
  31. if: "${{ matrix.php-version == '7.1' }}"
  32. with:
  33. php-version: "${{ matrix.php-version }}"
  34. coverage: "xdebug"
  35. ini-values: "zend.assertions=1"
  36. - name: "Install PHP with PCOV"
  37. uses: "shivammathur/setup-php@v2"
  38. if: "${{ matrix.php-version != '7.1' }}"
  39. with:
  40. php-version: "${{ matrix.php-version }}"
  41. coverage: "pcov"
  42. ini-values: "zend.assertions=1"
  43. - name: "Cache dependencies installed with composer"
  44. uses: "actions/cache@v2"
  45. with:
  46. path: "~/.composer/cache"
  47. key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
  48. restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
  49. - name: "Install dependencies with composer"
  50. run: "composer update --no-interaction --no-progress"
  51. - name: "Run PHPUnit"
  52. run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
  53. - name: "Upload coverage file"
  54. uses: "actions/upload-artifact@v2"
  55. with:
  56. name: "phpunit-${{ matrix.php-version }}.coverage"
  57. path: "coverage.xml"
  58. upload_coverage:
  59. name: "Upload coverage to Codecov"
  60. runs-on: "ubuntu-20.04"
  61. needs:
  62. - "phpunit"
  63. steps:
  64. - name: "Checkout"
  65. uses: "actions/checkout@v2"
  66. with:
  67. fetch-depth: 2
  68. - name: "Download coverage files"
  69. uses: "actions/download-artifact@v2"
  70. with:
  71. path: "reports"
  72. - name: "Upload to Codecov"
  73. uses: "codecov/codecov-action@v1"
  74. with:
  75. directory: reports