@@ -51,6 +51,18 @@ inputs:
5151 description : ' Space-separated list of PHP extensions to install via PIE (e.g., "flow-php/pg-query-ext:1.x-dev")'
5252 required : false
5353 default : ' '
54+ extra-working-directory :
55+ description : ' Optional additional Composer project to install (e.g. "web/landing"). Left empty to skip.'
56+ required : false
57+ default : ' '
58+ extra-cache-key-suffix :
59+ description : ' Cache key suffix for the extra working directory'
60+ required : false
61+ default : ' '
62+ extra-composer-file :
63+ description : ' composer.lock path (for the cache key) of the extra working directory'
64+ required : false
65+ default : ' **/composer.lock'
5466
5567runs :
5668 using : " composite"
@@ -90,35 +102,22 @@ runs:
90102 sudo pie install "$ext"
91103 done
92104
93- - name : " Get Composer Cache Directory"
94- id : composer-cache
95- shell : bash
96- working-directory : ${{ inputs.working-directory }}
97- run : |
98- echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
99-
100- - name : " Cache Composer dependencies"
101- uses : " actions/cache@v4"
105+ - name : " Install Composer dependencies"
106+ if : ${{ inputs.install-dependencies == 'true' }}
107+ uses : " ./.github/actions/composer-install"
102108 with :
103- path : " ${{ steps.composer-cache.outputs.dir }}"
104- key : " php-${{ inputs.php-version }}-${{ inputs.dependencies }}-composer${{ inputs.cache-key-suffix }}-${{ hashFiles(inputs.composer-file) }}"
105- restore-keys : |
106- php-${{ inputs.php-version }}-${{ inputs.dependencies }}-composer${{ inputs.cache-key-suffix }}-
107-
108- - name : " Install lowest dependencies"
109- if : ${{ inputs.dependencies == 'lowest' && inputs.install-dependencies == 'true' }}
110- shell : bash
111- working-directory : ${{ inputs.working-directory }}
112- run : " composer update --prefer-lowest --no-interaction --no-progress"
109+ php-version : " ${{ inputs.php-version }}"
110+ dependencies : " ${{ inputs.dependencies }}"
111+ working-directory : " ${{ inputs.working-directory }}"
112+ cache-key-suffix : " ${{ inputs.cache-key-suffix }}"
113+ composer-file : " ${{ inputs.composer-file }}"
113114
114- - name : " Install highest dependencies"
115- if : ${{ inputs.dependencies == 'highest' && inputs.install-dependencies == 'true' }}
116- shell : bash
117- working-directory : ${{ inputs.working-directory }}
118- run : " composer update --no-interaction --no-progress"
119-
120- - name : " Install locked dependencies"
121- if : ${{ inputs.dependencies == 'locked' && inputs.install-dependencies == 'true' }}
122- shell : bash
123- working-directory : ${{ inputs.working-directory }}
124- run : " composer install --no-interaction --no-progress"
115+ - name : " Install extra Composer dependencies"
116+ if : ${{ inputs.install-dependencies == 'true' && inputs.extra-working-directory != '' }}
117+ uses : " ./.github/actions/composer-install"
118+ with :
119+ php-version : " ${{ inputs.php-version }}"
120+ dependencies : " ${{ inputs.dependencies }}"
121+ working-directory : " ${{ inputs.extra-working-directory }}"
122+ cache-key-suffix : " ${{ inputs.extra-cache-key-suffix }}"
123+ composer-file : " ${{ inputs.extra-composer-file }}"
0 commit comments