continuous-integration.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
  2. name: "Continuous Integration"
  3. on:
  4. - "pull_request"
  5. env:
  6. COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist --optimize-autoloader"
  7. SYMFONY_PHPUNIT_VERSION: ""
  8. jobs:
  9. tests:
  10. name: "Tests"
  11. runs-on: "ubuntu-latest"
  12. strategy:
  13. matrix:
  14. php-version:
  15. - "5.3"
  16. - "5.4"
  17. - "5.5"
  18. - "5.6"
  19. - "7.0"
  20. - "7.1"
  21. - "7.2"
  22. - "7.3"
  23. - "7.4"
  24. dependencies:
  25. - "locked"
  26. - "highest"
  27. steps:
  28. - name: "Checkout"
  29. uses: "actions/checkout@v2"
  30. - name: "Install PHP"
  31. uses: "shivammathur/setup-php@v2"
  32. with:
  33. coverage: "none"
  34. extensions: "intl"
  35. ini-values: "memory_limit=-1"
  36. php-version: "${{ matrix.php-version }}"
  37. - name: "Determine composer cache directory"
  38. id: "determine-composer-cache-directory"
  39. run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
  40. - name: "Cache dependencies installed with composer"
  41. uses: "actions/cache@v1"
  42. with:
  43. path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
  44. key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
  45. restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
  46. - name: "Install highest dependencies from composer.json using composer binary provided by system"
  47. if: "matrix.dependencies == 'highest'"
  48. run: "composer update ${{ env.COMPOSER_FLAGS }}"
  49. - name: "Install dependencies from composer.lock using composer binary provided by system"
  50. if: "matrix.dependencies == 'locked'"
  51. run: "composer install ${{ env.COMPOSER_FLAGS }}"
  52. - name: "Install dependencies from composer.lock using composer binary from source"
  53. if: "matrix.dependencies == 'locked'"
  54. run: "bin/composer install ${{ env.COMPOSER_FLAGS }}"
  55. - name: "Prepare git environment"
  56. run: "git config --global user.name composer && git config --global user.email composer@example.com"
  57. - name: "Set SYMFONY_PHPUNIT_VERSION environment variable"
  58. if: "matrix.php-version == '7.4'"
  59. run: "echo \"::set-env name=SYMFONY_PHPUNIT_VERSION::7.5\""
  60. - name: "Run tests"
  61. run: "vendor/bin/simple-phpunit"