continuous-integration.yml 3.4 KB

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