continuous-integration.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: "Continuous Integration"
  2. on:
  3. pull_request: null
  4. env:
  5. COMPOSER_ROOT_VERSION: "2.1"
  6. jobs:
  7. phpunit:
  8. name: "PHPUnit"
  9. runs-on: "ubuntu-20.04"
  10. strategy:
  11. matrix:
  12. php-version:
  13. - "7.1"
  14. - "7.2"
  15. - "7.3"
  16. - "7.4"
  17. - "8.0"
  18. deps:
  19. - "normal"
  20. include:
  21. - deps: "low"
  22. php-version: "7.1"
  23. steps:
  24. - name: "Checkout"
  25. uses: "actions/checkout@v2"
  26. with:
  27. fetch-depth: 2
  28. - name: "Install PHP with pcov"
  29. uses: "shivammathur/setup-php@v2"
  30. if: "${{ matrix.php-version != '7.1' }}"
  31. with:
  32. php-version: "${{ matrix.php-version }}"
  33. coverage: "pcov"
  34. - name: "Install PHP with xdebug"
  35. uses: "shivammathur/setup-php@v2"
  36. if: "${{ matrix.php-version == '7.1' }}"
  37. with:
  38. php-version: "${{ matrix.php-version }}"
  39. coverage: "xdebug"
  40. - name: "Cache dependencies installed with composer"
  41. uses: "actions/cache@v2"
  42. with:
  43. path: "~/.composer/cache"
  44. key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
  45. restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
  46. # Remove this block when
  47. # https://github.com/felixfbecker/php-language-server-protocol/pull/15 is
  48. # merged and released
  49. - name: "Remove dependency on vimeo/psalm for PHP8"
  50. run: "composer remove --dev --no-update vimeo/psalm"
  51. if: "${{ matrix.php-version == '8.0' }}"
  52. - name: "Downgrade Composer"
  53. run: "composer self-update --1"
  54. if: "${{ matrix.php-version == '7.1' }}"
  55. - name: "Update dependencies with composer"
  56. run: "composer update --no-interaction --no-progress --no-suggest"
  57. if: "${{ matrix.deps == 'normal' }}"
  58. - name: "Install lowest possible dependencies with composer"
  59. run: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-lowest"
  60. if: "${{ matrix.deps == 'low' }}"
  61. - name: "Run PHPUnit"
  62. run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
  63. - name: "Upload to Codecov"
  64. uses: "codecov/codecov-action@v1"