Use cached builds for zts

This commit is contained in:
Shivam Mathur 2023-11-26 03:34:57 +05:30
parent 99a92d54d5
commit bbe1204148
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -99,25 +99,15 @@ add_devtools() {
add_log "${tick:?}" "$tool" "Added $tool $semver"
}
# Function to setup the nightly build from shivammathur/php-builder
setup_zts() {
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
}
# Function to setup the nightly build from shivammathur/php-builder
setup_nightly() {
if [ "$runner" = "self-hosted" ]; then
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
else
run_script "php-ubuntu" "$version" "${debug:?}"
fi
}
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
setup_old_versions() {
run_script "php5-ubuntu" "$version"
}
setup_cached_versions() {
run_script "php-ubuntu" "$version" "${debug:?}" "${ts:?}"
}
# Function to add PECL.
add_pecl() {
add_devtools phpize >/dev/null 2>&1
@ -158,13 +148,9 @@ get_php_packages() {
# Function to install packaged PHP
add_packaged_php() {
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
install_packages "${packages[@]}"
else
run_script "php-ubuntu" "$version" "${debug:?}"
fi
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
install_packages "${packages[@]}"
}
# Function to update PHP.
@ -181,14 +167,14 @@ update_php() {
# Function to install PHP.
add_php() {
if [[ "$version" =~ ${nightly_versions:?} ]] || [[ "${ts:?}" = "zts" ]]; then
setup_nightly
if [ "${runner:?}" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
add_packaged_php
switch_version >/dev/null 2>&1
add_pecl
elif [[ "$version" =~ ${old_versions:?} ]]; then
setup_old_versions
else
add_packaged_php
switch_version >/dev/null 2>&1
add_pecl
setup_cached_versions
fi
status="Installed"
}