continuous-integration.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. ini-values: "memory_limit=-1"
  35. php-version: "${{ matrix.php-version }}"
  36. - name: "Determine composer cache directory"
  37. id: "determine-composer-cache-directory"
  38. run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
  39. - name: "Cache dependencies installed with composer"
  40. uses: "actions/cache@v1"
  41. with:
  42. path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
  43. key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
  44. restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
  45. - name: "Install highest dependencies from composer.json using composer binary provided by system"
  46. if: "matrix.dependencies == 'highest'"
  47. run: "composer update ${{ env.COMPOSER_FLAGS }}"
  48. - name: "Install dependencies from composer.lock using composer binary provided by system"
  49. if: "matrix.dependencies == 'locked'"
  50. run: "composer install ${{ env.COMPOSER_FLAGS }}"
  51. - name: "Install dependencies from composer.lock using composer binary from source"
  52. if: "matrix.dependencies == 'locked'"
  53. run: "bin/composer install ${{ env.COMPOSER_FLAGS }}"
  54. - name: "Prepare git environment"
  55. run: "git config --global user.name composer && git config --global user.email composer@example.com"
  56. - name: "Set SYMFONY_PHPUNIT_VERSION environment variable"
  57. if: "matrix.php-version == '7.4'"
  58. run: "echo \"::set-env name=SYMFONY_PHPUNIT_VERSION::7.5\""
  59. - name: "Run tests"
  60. run: "vendor/bin/simple-phpunit"