Skip to content

Commit

Permalink
fix: add PHP 8.4 to Alpine; add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Nov 24, 2024
1 parent e4d3427 commit 0bb1b83
Show file tree
Hide file tree
Showing 10 changed files with 264 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/features-global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ jobs:
- php81-alpine-base
- php82-alpine-base
- php83-alpine-base
- php84-alpine-base
- php81-ubuntu-base
- php82-ubuntu-base
- php83-ubuntu-base
- php84-ubuntu-base
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/features-scenarios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
filter: '82'
- feature: php
filter: '83'
- feature: php
filter: '84'
- feature: phpmyadmin
- feature: playwright
- feature: ssh
Expand Down
79 changes: 78 additions & 1 deletion features/src/php/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ setup_php83_alpine() {
EXTENSIONS=
fi

# shellcheck disable=SC2086
apk add --no-cache \
icu-data-full ghostscript \
php83 php83-fpm php83-pear \
Expand Down Expand Up @@ -196,7 +197,7 @@ setup_php83_alpine() {
php83-xml \
php83-xmlreader \
php83-xmlwriter \
php83-zip
php83-zip ${EXTENSIONS}

if [ "${SKIP_GMAGICK}" != 'true' ]; then
apk add --no-cache php83-dev gcc make libc-dev graphicsmagick-dev libtool graphicsmagick libgomp
Expand All @@ -219,6 +220,77 @@ setup_php83_alpine() {
true
}

setup_php84_alpine() {
if [ "${LITE_INSTALL}" != 'true' ]; then
# missing: php84-pecl-mcrypt php84-pecl-timezonedb
EXTENSIONS="icu-data-full ghostscript php84-bcmath php84-ftp php84-intl php84-soap php84-pecl-igbinary php84-pecl-ssh2"
else
EXTENSIONS=
fi

# shellcheck disable=SC2086
apk add --no-cache \
icu-data-full ghostscript \
php84 php84-fpm php84-pear \
php84-pecl-apcu \
php84-calendar \
php84-ctype \
php84-curl \
php84-dom \
php84-exif \
php84-fileinfo \
php84-ftp \
php84-gd \
php84-gmp \
php84-iconv \
php84-mbstring \
php84-pecl-memcache \
php84-pecl-memcached \
php84-mysqli \
php84-mysqlnd \
php84-opcache \
php84-openssl \
php84-pcntl \
php84-pdo \
php84-pdo_mysql \
php84-pdo_sqlite \
php84-phar \
php84-posix \
php84-session \
php84-shmop \
php84-simplexml \
php84-sockets \
php84-sodium \
php84-sqlite3 \
php84-sysvsem \
php84-sysvshm \
php84-tokenizer \
php84-xml \
php84-xmlreader \
php84-xmlwriter \
php84-zip ${EXTENSIONS} -X https://dl-cdn.alpinelinux.org/alpine/edge/testing

if [ "${SKIP_GMAGICK}" != 'true' ]; then
apk add --no-cache php84-dev gcc make libc-dev graphicsmagick-dev libtool graphicsmagick libgomp -X https://dl-cdn.alpinelinux.org/alpine/edge/testing
pecl84 channel-update pecl.php.net
pecl84 install channel://pecl.php.net/gmagick-2.0.6RC1 < /dev/null || true
echo "extension=gmagick.so" > /etc/php84/conf.d/40_gmagick.ini
apk del --no-cache php84-dev gcc make libc-dev graphicsmagick-dev libtool
fi

# Alpine Edge: this symlink is broken
rm -f /usr/bin/phar.phar

[ ! -f /usr/bin/pear ] && ln -s /usr/bin/pear84 /usr/bin/pear
[ ! -f /usr/bin/peardev ] && ln -s /usr/bin/peardev84 /usr/bin/peardev
[ ! -f /usr/bin/pecl ] && ln -s /usr/bin/pecl84 /usr/bin/pecl
[ ! -f /usr/bin/phar.phar ] && ln -s /usr/bin/phar.phar84 /usr/bin/phar.phar
[ ! -f /usr/bin/phar ] && ln -s /usr/bin/phar84 /usr/bin/phar
[ ! -f /usr/bin/php ] && ln -s /usr/bin/php84 /usr/bin/php
[ ! -f /usr/sbin/php-fpm ] && ln -s /usr/sbin/php-fpm84 /usr/sbin/php-fpm
true
}

setup_php81_deb() {
if [ "${LITE_INSTALL}" != 'true' ]; then
EXTENSIONS="ghostscript php8.1-bcmath php8.1-igbinary php8.1-intl php8.1-mcrypt php8.1-soap php8.1-ssh2"
Expand Down Expand Up @@ -520,6 +592,11 @@ case "${ID_LIKE}" in
setup_php83_alpine
;;

"8.4")
PHP_INI_DIR=/etc/php84
setup_php84_alpine
;;

*)
echo "(!) PHP version ${PHP_VERSION} is not supported."
exit 1
Expand Down
1 change: 1 addition & 0 deletions features/test/_global/php84-alpine-base.sh
86 changes: 86 additions & 0 deletions features/test/_global/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,92 @@
"./dev-tools"
]
},
"php84-alpine-base": {
"image": "ghcr.io/automattic/vip-codespaces/alpine-base:latest",
"overrideCommand": false,
"features": {
"base": {},
"nginx": {
"mediaRedirectURL": ""
},
"php": {
"version": "8.4",
"composer": true
},
"mariadb": {
"installDatabaseToWorkspaces": true
},
"wordpress": {
"version": "latest",
"moveUploadsToWorkspaces": true,
"multisite": true,
"multisiteStyle": "subdirectory"
},
"wp-cli": {
"nightly": false
},
"vip-go-mu-plugins": {
"enabled": true,
"development_mode": false
},
"dev-tools": {},
"elasticsearch": {
"enabled": true,
"installDataToWorkspaces": true
},
"memcached": {
"enabled": true
},
"vip-cli": {
"enabled": true
},
"mailpit": {
"enabled": true
},
"phpmyadmin": {
"enabled": true
},
"xdebug": {
"enabled": true,
"mode": "debug,develop"
},
"mc": {
"enabled": true
},
"photon": {
"enabled": true,
"disable_optimizations": false
},
"cron": {
"enabled": true,
"run_wp_cron": true,
"wp_cron_schedule": "*/15 * * * *"
},
"wptl": {
"enabled": true,
"version": "latest"
}
},
"overrideFeatureInstallOrder": [
"./base",
"./wp-cli",
"./mariadb",
"./mc",
"./nginx",
"./php",
"./vip-cli",
"./wordpress",
"./cron",
"./elasticsearch",
"./mailpit",
"./memcached",
"./photon",
"./phpmyadmin",
"./vip-go-mu-plugins",
"./xdebug",
"./dev-tools"
]
},

"php81-ubuntu-base": {
"image": "ghcr.io/automattic/vip-codespaces/ubuntu-base:latest",
Expand Down
1 change: 1 addition & 0 deletions features/test/php/alpine-84-mcr.sh
1 change: 1 addition & 0 deletions features/test/php/alpine-84.sh
91 changes: 91 additions & 0 deletions features/test/php/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,25 @@
"./vip-cli"
]
},
"alpine-84": {
"image": "ghcr.io/automattic/vip-codespaces/alpine-base:latest",
"overrideCommand": false,
"features": {
"php": {
"version": "8.4",
"composer": true
},
"mailpit": {},
"vip-cli": {},
"xdebug": {}
},
"overrideFeatureInstallOrder": [
"./php",
"./xdebug",
"./mailpit",
"./vip-cli"
]
},

"ubuntu-81": {
"image": "ghcr.io/automattic/vip-codespaces/ubuntu-base:latest",
Expand Down Expand Up @@ -120,6 +139,27 @@
"./vip-cli"
]
},
"ubuntu-84": {
"image": "ghcr.io/automattic/vip-codespaces/ubuntu-base:latest",
"overrideCommand": false,
"features": {
"base": {},
"php": {
"version": "8.4",
"composer": true
},
"mailpit": {},
"vip-cli": {},
"xdebug": {}
},
"overrideFeatureInstallOrder": [
"./base",
"./php",
"./xdebug",
"./mailpit",
"./vip-cli"
]
},

"ubuntu-81-mcr": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
Expand Down Expand Up @@ -199,6 +239,32 @@
"./vip-cli"
]
},
"ubuntu-84-mcr": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"base": {},
"entrypoints": {},
"php": {
"version": "8.3",
"composer": true,
"install-runit-service": false,
"lite-install": true
},
"mailpit": {
"install-runit-service": false
},
"vip-cli": {},
"xdebug": {}
},
"overrideFeatureInstallOrder": [
"./base",
"./entrypoints",
"./php",
"./xdebug",
"./mailpit",
"./vip-cli"
]
},

"alpine-81-mcr": {
"image": "mcr.microsoft.com/devcontainers/base:alpine",
Expand Down Expand Up @@ -274,5 +340,30 @@
"./mailpit",
"./vip-cli"
]
},
"alpine-84-mcr": {
"image": "mcr.microsoft.com/devcontainers/base:alpine",
"features": {
"entrypoints": {},
"php": {
"version": "8.4",
"composer": true,
"install-runit-service": false,
"lite-install": true,
"skip-gmagick": true
},
"mailpit": {
"install-runit-service": false
},
"vip-cli": {},
"xdebug": {}
},
"overrideFeatureInstallOrder": [
"./entrypoints",
"./php",
"./xdebug",
"./mailpit",
"./vip-cli"
]
}
}
1 change: 1 addition & 0 deletions features/test/php/ubuntu-84-mcr.sh
1 change: 1 addition & 0 deletions features/test/php/ubuntu-84.sh

0 comments on commit 0bb1b83

Please sign in to comment.