Skip to content
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

Add Alpine testing to CI #8621

Closed
wants to merge 9 commits into from
Closed
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
170 changes: 116 additions & 54 deletions .github/actions/apt-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,115 @@ runs:
run: |
set -x

sudo apt-get update
sudo apt-get install \
bison \
re2c \
locales \
ldap-utils \
openssl \
slapd \
language-pack-de \
libgmp-dev \
libicu-dev \
libtidy-dev \
libenchant-2-dev \
libaspell-dev \
libpspell-dev \
libsasl2-dev \
libxpm-dev \
libzip-dev \
libsqlite3-dev \
libwebp-dev \
libonig-dev \
libkrb5-dev \
libgssapi-krb5-2 \
libcurl4-openssl-dev \
libxml2-dev \
libxslt1-dev \
libpq-dev \
libreadline-dev \
libldap2-dev \
libsodium-dev \
libargon2-0-dev \
libmm-dev \
libsnmp-dev \
postgresql \
postgresql-contrib \
snmpd \
snmp-mibs-downloader \
freetds-dev \
unixodbc-dev \
llvm \
libc-client-dev \
dovecot-core \
dovecot-pop3d \
dovecot-imapd \
sendmail \
firebird-dev \
liblmdb-dev \
libtokyocabinet-dev \
libdb-dev \
libqdbm-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev
if [ -f /etc/alpine-release ]; then
apk update -q
apk add \
build-base \
autoconf \
unzip \
bison \
re2c \
pkgconf \
mysql-client \
aspell-dev \
hunspell-dev \
hunspell-en \
bzip2-dev \
curl-dev \
freetype-dev \
gettext-dev \
gnu-libiconv-dev \
gmp-dev \
icu-dev \
jpeg-dev \
libffi-dev \
libpng-dev \
libsodium-dev \
libwebp-dev \
libxml2-dev \
libxpm-dev \
libxslt-dev \
libzip-dev \
oniguruma-dev \
openssl-dev \
readline-dev \
sqlite-dev \
tidyhtml-dev \
krb5-dev \
gdbm-dev \
lmdb-dev \
argon2-dev \
enchant2-dev \
freetds-dev \
imap-dev \
net-snmp-dev \
openldap-dev \
unixodbc-dev \
postgresql14-dev \
tzdata \
musl-locales \
musl-locales-lang
else
export ENV DEBIAN_FRONTEND=noninteractive
apt-get -y -qq update
apt-get install -y -q \
build-essential \
autoconf \
unzip \
bison \
re2c \
locales \
ldap-utils \
openssl \
slapd \
mysql-client \
language-pack-de \
libgmp-dev \
libicu-dev \
libtidy-dev \
libenchant-2-dev \
libaspell-dev \
libpspell-dev \
libsasl2-dev \
libxpm-dev \
libzip-dev \
libbz2-dev \
libsqlite3-dev \
libwebp-dev \
libonig-dev \
libkrb5-dev \
libgssapi-krb5-2 \
libcurl4-openssl-dev \
libxml2-dev \
libxslt1-dev \
libpq-dev \
libreadline-dev \
libldap2-dev \
libsodium-dev \
libargon2-0-dev \
libmm-dev \
libsnmp-dev \
postgresql \
postgresql-contrib \
snmpd \
snmp-mibs-downloader \
freetds-dev \
unixodbc-dev \
llvm \
libc-client-dev \
dovecot-core \
dovecot-pop3d \
dovecot-imapd \
sendmail \
firebird-dev \
liblmdb-dev \
libtokyocabinet-dev \
libdb-dev \
libqdbm-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev
fi

mkdir /opt/oracle
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
Expand All @@ -70,4 +126,10 @@ runs:
rm /opt/oracle/instantclient/sdk/include/ldap.h
# fix debug build warning: zend_signal: handler was replaced for signal (2) after startup
echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora
sudo sh -c 'echo /opt/oracle/instantclient >/etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig'
if [ -f /etc/alpine-release ]; then
apk add libaio libc6-compat libnsl
ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2
echo "/lib:/usr/local/lib:/usr/lib:/opt/oracle/instantclient" > /etc/ld-musl-x86_64.path
else
sh -c 'echo /opt/oracle/instantclient >/etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig'
fi
13 changes: 7 additions & 6 deletions .github/actions/configure-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ runs:
--enable-pcntl \
--with-readline \
--enable-mbstring \
$(if [ -f /etc/alpine-release ]; then echo --with-iconv=/usr/include/gnu-libiconv; else echo ; fi) \
--with-curl \
--with-gettext \
--enable-sockets \
Expand All @@ -66,19 +67,19 @@ runs:
--with-cdb \
--enable-flatfile \
--enable-inifile \
--with-tcadb \
$(if [ -f /etc/alpine-release ]; then echo ; else echo --with-tcadb; fi) \
--with-lmdb \
--with-qdbm \
$(if [ -f /etc/alpine-release ]; then echo --with-gdbm; else echo --with-qdbm; fi) \
--with-snmp \
--with-unixODBC \
--with-imap \
$(if [ -f /etc/alpine-release ]; then echo ; else echo --with-imap; fi) \
--with-imap-ssl \
--with-pdo-odbc=unixODBC,/usr \
--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \
--with-oci8=shared,instantclient,/opt/oracle/instantclient \
$(if [ -f /etc/alpine-release ]; then echo ; else echo --with-pdo-oci=shared,instantclient,/opt/oracle/instantclient; fi) \
$(if [ -f /etc/alpine-release ]; then echo ; else echo --with-oci8=shared,instantclient,/opt/oracle/instantclient; fi) \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-pdo-firebird \
$(if [ -f /etc/alpine-release ]; then echo ; else echo --with-pdo-firebird; fi) \
--with-pdo-dblib \
--enable-werror \
${{ inputs.configurationParameters }}
6 changes: 3 additions & 3 deletions .github/actions/install-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ runs:
- shell: bash
run: |
set -x
sudo make install
sudo mkdir /etc/php.d
sudo chmod 777 /etc/php.d
make install
mkdir /etc/php.d
chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
echo extension=oci8.so > /etc/php.d/oci8.ini
Expand Down
14 changes: 0 additions & 14 deletions .github/actions/setup-mssql/action.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/actions/setup-oracle/action.yml

This file was deleted.

36 changes: 20 additions & 16 deletions .github/actions/setup-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@ runs:
run: |
set -x

sudo service mysql start
sudo service slapd start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
# Ensure local_infile tests can run.
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;"
sudo locale-gen de_DE
if [ -f /etc/alpine-release ]; then
echo "TODO SETUP"
else
service mysql start
service slapd start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
# Ensure local_infile tests can run.
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;"
locale-gen de_DE

./.github/scripts/setup-slapd.sh
./.github/scripts/setup-slapd.sh

sudo cp ext/snmp/tests/snmpd.conf /etc/snmp
sudo cp ext/snmp/tests/bigtest /etc/snmp
sudo service snmpd restart
cp ext/snmp/tests/snmpd.conf /etc/snmp
cp ext/snmp/tests/bigtest /etc/snmp
service snmpd restart

sudo groupadd -g 5000 vmail
sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail
sudo cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf
sudo cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass
sudo service dovecot restart
groupadd -g 5000 vmail
useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail
cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf
cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass
service dovecot restart
fi
8 changes: 4 additions & 4 deletions .github/actions/test-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ runs:
- shell: bash
run: |
set -x
export MYSQL_TEST_USER=root
export MYSQL_TEST_PASSWD=root
export MYSQL_TEST_USER=useru
export MYSQL_TEST_PASSWD=userp
if [[ -z "$PDO_MYSQL_TEST_DSN" ]]; then
export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test"
fi
export PDO_MYSQL_TEST_USER=root
export PDO_MYSQL_TEST_PASS=root
export PDO_MYSQL_TEST_USER=useru
export PDO_MYSQL_TEST_PASS=userp
export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0"
export PDO_DBLIB_TEST_USER="pdo_test"
export PDO_DBLIB_TEST_PASS="password"
Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,47 @@ env:
jobs:
LINUX_X64:
services:
mysql:
image: mysql:8
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=rootu -e MYSQL_USER=useru -e MYSQL_PASSWORD=userp -e MYSQL_DATABASE=test --entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: '<YourStrong@Passw0rd>'
oracle:
image: gvenzl/oracle-xe:21-slim-faststart
env:
ORACLE_PASSWORD: pass
strategy:
fail-fast: false
matrix:
include:
- debug: true
- alpine: false
debug: true
zts: false
- debug: false
# - alpine: false
# debug: false
# zts: true
- alpine: true
debug: true
zts: true
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
name: "${{ matrix.alpine && 'ALPINE' || 'LINUX' }}_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-22.04
container:
image: "${{ matrix.alpine && 'alpine:3.15' || 'ubuntu:focal' }}"
steps:
- name: apt install bash/git
if: matrix.alpine
run: apk update -q && apk add bash git
- name: git checkout
uses: actions/checkout@v3
- name: Create MSSQL container
uses: ./.github/actions/setup-mssql
- name: Create Oracle container
uses: ./.github/actions/setup-oracle
- name: apt
uses: ./.github/actions/apt-x64
- name: ccache
Expand Down Expand Up @@ -136,6 +154,7 @@ jobs:
-d opcache.jit_buffer_size=16M
MACOS_DEBUG_NTS:
runs-on: macos-11
if: false
steps:
- name: git checkout
uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion sapi/cli/tests/bug61546.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ $php = getenv("TEST_PHP_EXECUTABLE_ESCAPED");
$test_code = <<<PHP
<?php
chdir('..');
var_dump(get_current_user() != "");
var_dump(getmyinode() !== false);
var_dump(getlastmod() != false);
chdir('..');
var_dump(getmyinode() !== false);
var_dump(getlastmod() != false);
Expand All @@ -29,3 +30,4 @@ unlink("bug61546_sub.php");
bool(true)
bool(true)
bool(true)
bool(true)