continuous-integration.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. experimental: [false]
  32. include:
  33. - php-version: 5.3
  34. dependencies: highest
  35. os: ubuntu-latest
  36. experimental: false
  37. - php-version: 5.3
  38. dependencies: lowest
  39. os: ubuntu-latest
  40. experimental: false
  41. - php-version: 7.4
  42. dependencies: highest
  43. os: ubuntu-latest
  44. experimental: true # TODO fix build errors there if possible
  45. - php-version: 7.4
  46. os: windows-latest
  47. dependencies: locked
  48. experimental: false
  49. - php-version: 7.4
  50. os: macos-latest
  51. dependencies: locked
  52. experimental: false
  53. - php-version: 8.0
  54. dependencies: highest
  55. os: ubuntu-latest
  56. experimental: true
  57. steps:
  58. - name: "Checkout"
  59. uses: "actions/checkout@v2"
  60. - name: "Install PHP"
  61. uses: "shivammathur/setup-php@v2"
  62. with:
  63. coverage: "none"
  64. extensions: "intl"
  65. ini-values: "memory_limit=-1"
  66. php-version: "${{ matrix.php-version }}"
  67. - name: "Determine composer cache directory"
  68. id: "determine-composer-cache-directory"
  69. run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
  70. - name: "Cache dependencies installed with composer"
  71. uses: "actions/cache@v1"
  72. with:
  73. path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
  74. key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
  75. restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
  76. - name: "Install highest dependencies from composer.json using composer binary provided by system"
  77. if: "matrix.dependencies == 'highest'"
  78. run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
  79. - name: "Install lowest dependencies from composer.json using composer binary provided by system"
  80. if: "matrix.dependencies == 'lowest'"
  81. run: "composer update ${{ env.COMPOSER_FLAGS }} --prefer-lowest"
  82. - name: "Install dependencies from composer.lock using composer binary provided by system"
  83. if: "matrix.dependencies == 'locked'"
  84. run: "composer install ${{ env.COMPOSER_FLAGS }}"
  85. - name: "Run install again using composer binary from source"
  86. run: "bin/composer install ${{ env.COMPOSER_FLAGS }}"
  87. - name: "Validate composer.json"
  88. run: "bin/composer validate"
  89. - name: "Prepare git environment"
  90. run: "git config --global user.name composer && git config --global user.email composer@example.com"
  91. - name: "Set SYMFONY_PHPUNIT_VERSION environment variable"
  92. if: "matrix.php-version == '7.4'"
  93. run: "echo \"::set-env name=SYMFONY_PHPUNIT_VERSION::7.5\""
  94. - name: "Run tests"
  95. run: "vendor/bin/simple-phpunit"