continuous-integration.yml 3.1 KB

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