action.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: "Setup PHP with Composer deps"
  2. inputs:
  3. os:
  4. description: 'OS version'
  5. required: true
  6. php:
  7. description: 'PHP version'
  8. required: true
  9. php-coverage:
  10. description: 'Enable coverage driver'
  11. required: false
  12. default: 'no'
  13. tools:
  14. description: 'tools'
  15. required: false
  16. default: 'none'
  17. composer-flags:
  18. description: 'Composer flags'
  19. required: false
  20. composer-flex-with-symfony-version:
  21. description: 'Sf version to determine with Flex'
  22. required: false
  23. runs:
  24. using: "composite"
  25. steps:
  26. - name: Resolve PHP tools flag
  27. uses: actions/github-script@v7
  28. id: setup-php-resolve-tools
  29. with:
  30. script: 'return "${{ inputs.composer-flex-with-symfony-version }}" ? "flex" : "none"'
  31. result-encoding: string
  32. - name: Resolve PHP coverage flag
  33. uses: actions/github-script@v7
  34. id: setup-php-resolve-coverage
  35. with:
  36. script: 'return "${{ inputs.php-coverage }}" == "yes" ? "pcov" : "none"'
  37. result-encoding: string
  38. - name: Setup PHP
  39. uses: ./.github/composite-actions/setup-php
  40. with:
  41. version: ${{ inputs.php }}
  42. coverage: ${{ steps.setup-php-resolve-coverage.outputs.result }}
  43. tools: ${{ steps.setup-php-resolve-tools.outputs.result }}, ${{ inputs.tools }}
  44. - name: Configure Symfony Flex
  45. if: inputs.composer-flex-with-symfony-version
  46. shell: bash
  47. run: composer config extra.symfony.require ${{ inputs.composer-flex-with-symfony-version }}
  48. - name: Install Composer deps
  49. uses: ./.github/composite-actions/install-composer-deps
  50. with:
  51. flags: ${{ inputs.composer-flags }}