@@ -7,11 +7,13 @@ function help {
7
7
echo " "
8
8
echo " Run a QA JOB as specified in a JSON object."
9
9
echo " The JSON should include each of the following elements:"
10
- echo " - command: command to run"
11
- echo " - php: the PHP version to use"
12
- echo " - extensions: a list of additional extensions to enable"
13
- echo " - ini: a list of php.ini directives"
14
- echo " - dependencies: the dependency set to run against (lowest, latest, locked)"
10
+ echo " - command: command to run"
11
+ echo " - php: the PHP version to use"
12
+ echo " - extensions: a list of additional extensions to enable"
13
+ echo " - ini: a list of php.ini directives"
14
+ echo " - dependencies: the dependency set to run against (lowest, latest, locked)"
15
+ echo " - ignore_php_platform_requirement: flag to enable/disable the PHP platform requirement when executing composer \` install\` or \` update\` "
16
+ echo " - additional_composer_arguments: a list of composer arguments to be added when \` install\` or \` update\` is called."
15
17
echo " "
16
18
}
17
19
@@ -77,10 +79,11 @@ function checkout {
77
79
fi
78
80
}
79
81
80
- function composer_install {
82
+ function composer_install_dependencies {
81
83
local DEPS=$1
82
84
local IGNORE_PHP_PLATFORM_REQUIREMENT=$2
83
- local COMPOSER_ARGS=" --ansi --no-interaction --no-progress --prefer-dist"
85
+ local ADDITIONAL_COMPOSER_ARGUMENTS=$3
86
+ local COMPOSER_ARGS=" --ansi --no-interaction --no-progress --prefer-dist ${ADDITIONAL_COMPOSER_ARGUMENTS} "
84
87
if [[ " ${IGNORE_PHP_PLATFORM_REQUIREMENT} " == " true" ]]; then
85
88
COMPOSER_ARGS=" ${COMPOSER_ARGS} --ignore-platform-req=php"
86
89
fi
@@ -99,7 +102,7 @@ function composer_install {
99
102
* )
100
103
echo " Installing dependencies as specified in lockfile via Composer"
101
104
# shellcheck disable=SC2086
102
- composer install ${COMPOSER_ARGS}
105
+ echo composer install ${COMPOSER_ARGS}
103
106
;;
104
107
esac
105
108
@@ -148,6 +151,7 @@ INI=$(echo "${JOB}" | jq -r '.ini // [] | join("\n")')
148
151
DEPS=$( echo " ${JOB} " | jq -r ' .dependencies // "locked"' )
149
152
IGNORE_PLATFORM_REQS_ON_8=$( echo " ${JOB} " | jq -r ' if has("ignore_platform_reqs_8") | not then "yes" elif .ignore_platform_reqs_8 then "yes" else "no" end' )
150
153
IGNORE_PHP_PLATFORM_REQUIREMENT=$( echo " ${JOB} " | jq -r ' .ignore_php_platform_requirement' )
154
+ ADDITIONAL_COMPOSER_ARGUMENTS=$( echo " ${JOB} " | jq -r ' .additional_composer_arguments // [] | join("\n")' )
151
155
152
156
# Old matrix generation
153
157
if [ " ${IGNORE_PHP_PLATFORM_REQUIREMENT} " == " null" ]; then
@@ -177,7 +181,7 @@ if [[ "${GITHUB_TOKEN}" != "" ]];then
177
181
composer config --global github-oauth.github.com " ${GITHUB_TOKEN} "
178
182
fi
179
183
180
- composer_install " ${DEPS} " " ${IGNORE_PHP_PLATFORM_REQUIREMENT} "
184
+ composer_install_dependencies " ${DEPS} " " ${IGNORE_PHP_PLATFORM_REQUIREMENT} " " ${ADDITIONAL_COMPOSER_ARGUMENTS }"
181
185
182
186
if [[ " ${COMMAND} " =~ phpunit ]]; then
183
187
echo " Setting up PHPUnit problem matcher"
0 commit comments