Skip to content

Provide support for laminas-ci-matrix v1.9 #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ The JSON string should represent an object with the following information:
"php.ini directives, one per element; e.g. 'memory_limit=-1'"
],
"dependencies": "dependencies to test against; one of lowest, locked, latest",
"ignore_platform_reqs_on_8": "(boolean; OPTIONAL) Whether or not to ignore platform requirements on PHP 8; defaults to true",
"ignore_platform_reqs_on_8": "(boolean; OPTIONAL; DEPRECATED) Whether or not to ignore platform requirements on PHP 8; defaults to true",
"ignore_php_platform_requirement": "(boolean; OPTIONAL) Whether or not to ignore PHP platform requirement; defaults to false",
"command": "command to run to perform the check (empty in case you dont want to excecute any command)"
}
```
Expand Down
21 changes: 15 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,9 @@ function checkout {

function composer_install {
local DEPS=$1
local PHP=$2
local IGNORE_PLATFORM_REQS_ON_8=$3
local IGNORE_PHP_PLATFORM_REQUIREMENT=$2
local COMPOSER_ARGS="--ansi --no-interaction --no-progress --prefer-dist"
if [[ "${IGNORE_PLATFORM_REQS_ON_8}" == "yes" && "${PHP}" =~ ^8. ]];then
# TODO: Remove this when it's not an issue, and/or provide a config
# option to disable the behavior.
if [[ "${IGNORE_PHP_PLATFORM_REQUIREMENT}" == "true" ]];then
COMPOSER_ARGS="${COMPOSER_ARGS} --ignore-platform-req=php"
fi

Expand Down Expand Up @@ -150,6 +147,17 @@ EXTENSIONS=$(echo "${JOB}" | jq -r ".extensions // [] | map(\"php${PHP}-\"+.) |
INI=$(echo "${JOB}" | jq -r '.ini // [] | join("\n")')
DEPS=$(echo "${JOB}" | jq -r '.dependencies // "locked"')
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')
IGNORE_PHP_PLATFORM_REQUIREMENT=$(echo "${JOB}" | jq -r '.ignore_php_platform_requirement')

# Old matrix generation
if [ "${IGNORE_PHP_PLATFORM_REQUIREMENT}" == "null" ]; then
IGNORE_PHP_PLATFORM_REQUIREMENT="false"

# Provide BC compatibility
if [ "${IGNORE_PLATFORM_REQS_ON_8}" == "yes" ] && [[ "${PHP}" =~ ^8 ]]; then
IGNORE_PHP_PLATFORM_REQUIREMENT="true"
fi
fi

if [[ "${EXTENSIONS}" != "" ]];then
/scripts/extensions.sh "${PHP}" "${EXTENSIONS}"
Expand All @@ -168,7 +176,8 @@ php -m
if [[ "${GITHUB_TOKEN}" != "" ]];then
composer config --global github-oauth.github.com "${GITHUB_TOKEN}"
fi
composer_install "${DEPS}" "${PHP}" "${IGNORE_PLATFORM_REQS_ON_8}"

composer_install "${DEPS}" "${IGNORE_PHP_PLATFORM_REQUIREMENT}"

if [[ "${COMMAND}" =~ phpunit ]];then
echo "Setting up PHPUnit problem matcher"
Expand Down