Skip to content

Commit a4af145

Browse files
committed
Migrate to GitHub actions
1 parent c77bbcd commit a4af145

File tree

9 files changed

+779
-0
lines changed

9 files changed

+779
-0
lines changed

.github/actions/configure/action.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: ./configure
2+
inputs:
3+
configuration-parameters:
4+
required: false
5+
runs:
6+
using: composite
7+
steps:
8+
- shell: bash
9+
run: |
10+
if [ "$ARCH" == "macos" ]; then
11+
export PATH="/usr/local/opt/bison/bin:$PATH"
12+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig"
13+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig"
14+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig"
15+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
16+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig"
17+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig"
18+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig"
19+
fi
20+
21+
./buildconf --force
22+
23+
configureParameters=(
24+
--enable-bcmath
25+
--enable-calendar
26+
--enable-dba
27+
--enable-exif
28+
--enable-fpm
29+
--enable-ftp
30+
--enable-gd
31+
--enable-intl
32+
--enable-mbstring
33+
--enable-option-checking=fatal
34+
--enable-pcntl
35+
--enable-shmop
36+
--enable-soap
37+
--enable-sockets
38+
--enable-sysvmsg
39+
--enable-sysvsem
40+
--enable-sysvshm
41+
--enable-werror
42+
--enable-xmlreader
43+
--enable-zend-test
44+
--prefix=${{ env.arch != 'macos' && '/usr' || '/usr/local' || '' }}
45+
--with-zip
46+
--with-bz2${{ env.arch == 'macos' && '=/usr/local/opt/bzip2' || '' }}
47+
--with-config-file-path=/etc
48+
--with-config-file-scan-dir=/etc/php.d
49+
--with-curl
50+
--with-ffi
51+
--with-freetype
52+
--with-gettext${{ env.arch == 'macos' && '=/usr/local/opt/gettext' || '' }}
53+
--with-gmp${{ env.arch == 'macos' && '=/usr/local/opt/gmp' || '' }}
54+
--with-jpeg
55+
--with-kerberos
56+
--with-mhash
57+
--with-mysqli=mysqlnd
58+
--with-openssl
59+
--with-pdo-mysql=mysqlnd
60+
--with-pdo-pgsql${{ env.arch == 'macos' && '=/usr/local/opt/libpq' || '' }}
61+
--with-pdo-sqlite
62+
--with-pgsql${{ env.arch == 'macos' && '=/usr/local/opt/libpq' || '' }}
63+
--with-pspell=${{ env.arch != 'macos' && '/usr' || '/usr/local/opt/aspell' }}
64+
--with-readline${{ env.arch == 'macos' && '=/usr/local/opt/readline' || '' }}
65+
--with-sodium
66+
--with-tidy${{ env.arch == 'macos' && '=/usr/local/opt/tidyp' || '' }}
67+
--with-webp
68+
--with-xsl
69+
--with-zlib
70+
--without-pear
71+
${{ inputs.configuration-parameters }}
72+
)
73+
74+
if [ "$ARCH" == "linux-x64" ]; then
75+
configureParameters+=(
76+
--enable-flatfile
77+
--enable-inifile
78+
--with-cdb
79+
--with-enchant=/usr
80+
--with-imap
81+
--with-imap-ssl
82+
--with-kerberos
83+
--with-ldap
84+
--with-ldap-sasl
85+
--with-lmdb
86+
--with-oci8=shared,instantclient,/opt/oracle/instantclient
87+
--with-password-argon2
88+
--with-pdo-dblib
89+
--with-pdo-firebird
90+
--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient
91+
--with-pdo-odbc=unixODBC,/usr
92+
--with-qdbm
93+
--with-snmp
94+
--with-tcadb
95+
--with-unixODBC
96+
)
97+
fi
98+
99+
if [ "$ARCH" == "linux-i386" ]; then
100+
configureParameters+=(--build=i686-pc-linux-gnu)
101+
fi
102+
103+
if [ "$ARCH" != "macos" ]; then
104+
configureParameters+=(
105+
--enable-phpdbg
106+
--with-xpm
107+
--with-zlib-dir=/usr
108+
)
109+
fi
110+
111+
if [ "$ARCH" == "macos" ]; then
112+
configureParameters+=(
113+
--with-iconv=/usr/local/opt/libiconv
114+
--with-libxml
115+
)
116+
fi
117+
118+
./configure "${configureParameters[@]}"

.github/actions/deps/action.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Install dependencies
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: bash
6+
run: |
7+
if [ "$ARCH" == "linux-x64" ]; then
8+
sudo apt install bison \
9+
re2c \
10+
locales \
11+
ldap-utils \
12+
openssl \
13+
slapd \
14+
language-pack-de \
15+
libgmp-dev \
16+
libicu-dev \
17+
libtidy-dev \
18+
libenchant-dev \
19+
libaspell-dev \
20+
libpspell-dev \
21+
libsasl2-dev \
22+
libxpm-dev \
23+
libzip-dev \
24+
libsqlite3-dev \
25+
libwebp-dev \
26+
libonig-dev \
27+
libkrb5-dev \
28+
libgssapi-krb5-2 \
29+
libcurl4-openssl-dev \
30+
libxml2-dev \
31+
libxslt1-dev \
32+
libpq-dev \
33+
libreadline-dev \
34+
libldap2-dev \
35+
libsodium-dev \
36+
libargon2-0-dev \
37+
libmm-dev \
38+
libsnmp-dev \
39+
postgresql \
40+
postgresql-contrib \
41+
snmpd \
42+
snmp-mibs-downloader \
43+
freetds-dev \
44+
unixodbc-dev \
45+
llvm \
46+
libc-client-dev \
47+
dovecot-core \
48+
dovecot-pop3d \
49+
dovecot-imapd \
50+
sendmail \
51+
firebird-dev \
52+
liblmdb-dev \
53+
libtokyocabinet-dev \
54+
libdb-dev \
55+
libqdbm-dev \
56+
libjpeg-dev \
57+
libpng-dev \
58+
libfreetype6-dev
59+
mkdir /opt/oracle
60+
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
61+
unzip instantclient-basiclite-linuxx64.zip
62+
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip
63+
unzip instantclient-sdk-linuxx64.zip
64+
mv instantclient_*_* /opt/oracle/instantclient
65+
# Interferes with libldap2 headers.
66+
rm /opt/oracle/instantclient/sdk/include/ldap.h
67+
fi
68+
if [ "$ARCH" == "linux-i386" ]; then
69+
sudo dpkg --add-architecture i386
70+
sudo apt-get update -y | true
71+
sudo apt-get install -y gcc-multilib
72+
sudo apt-get install -y g++-multilib
73+
sudo apt-get purge -y libxml2
74+
# TODO: Reenable postgresql + postgresql-contrib packages once they work again.
75+
sudo apt-get purge -y libpq5
76+
sudo apt-get install -y libc6:i386
77+
sudo apt-get install -y bison \
78+
re2c \
79+
locales \
80+
language-pack-de \
81+
libssl-dev:i386 \
82+
zlib1g-dev:i386 \
83+
libxml2-dev:i386 \
84+
libgmp-dev:i386 \
85+
libicu-dev:i386 \
86+
libtidy-dev:i386 \
87+
libaspell-dev:i386 \
88+
libpspell-dev:i386 \
89+
libsasl2-dev:i386 \
90+
libxpm-dev:i386 \
91+
libjpeg-dev:i386 \
92+
libpng-dev:i386 \
93+
libzip-dev:i386 \
94+
libbz2-dev:i386 \
95+
libsqlite3-dev:i386 \
96+
libwebp-dev:i386 \
97+
libonig-dev:i386 \
98+
libkrb5-dev:i386 \
99+
libgssapi-krb5-2:i386 \
100+
libcurl4-openssl-dev:i386 \
101+
libxml2-dev:i386 \
102+
libxslt1-dev:i386 \
103+
libpq-dev:i386 \
104+
libreadline-dev:i386 \
105+
libffi-dev:i386 \
106+
libfreetype6-dev:i386 \
107+
libsodium-dev:i386
108+
fi
109+
if [ "$ARCH" == "macos" ]; then
110+
brew install pkg-config \
111+
autoconf \
112+
bison \
113+
re2c
114+
brew install openssl@1.1 \
115+
krb5 \
116+
bzip2 \
117+
enchant \
118+
libffi \
119+
libpng \
120+
webp \
121+
freetype \
122+
intltool \
123+
icu4c \
124+
libiconv \
125+
zlib \
126+
t1lib \
127+
gd \
128+
libzip \
129+
gmp \
130+
tidyp \
131+
libxml2 \
132+
libxslt \
133+
postgresql
134+
brew link icu4c gettext --force
135+
fi

.github/actions/install/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Install
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: bash
6+
run: |
7+
if [ "$ARCH" != "macos" ]; then
8+
set -e
9+
sudo make install
10+
sudo mkdir /etc/php.d
11+
sudo chmod 777 /etc/php.d
12+
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
13+
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
14+
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
15+
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
16+
else
17+
sudo make install
18+
fi

.github/actions/mssql/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Create mssql container
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: bash
6+
run: |
7+
docker run \
8+
-e "ACCEPT_EULA=Y" \
9+
-e "SA_PASSWORD=<YourStrong@Passw0rd>" \
10+
-p 1433:1433 \
11+
--name sql1 \
12+
-h sql1 \
13+
-d mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-16.04

.github/actions/setup/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Setup
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: bash
6+
run: |
7+
set -e
8+
sudo service mysql start
9+
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
10+
11+
if [ "$ARCH" == "linux-x64" ]; then
12+
sudo service postgresql start
13+
sudo service slapd start
14+
# Ensure local_infile tests can run.
15+
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
16+
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
17+
sudo -u postgres psql -c "CREATE DATABASE test;"
18+
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;"
19+
sudo locale-gen de_DE
20+
21+
./.github/scripts/setup-slapd.sh
22+
23+
set -e
24+
sudo cp ext/snmp/tests/snmpd.conf /etc/snmp
25+
sudo cp ext/snmp/tests/bigtest /etc/snmp
26+
sudo service snmpd restart
27+
28+
set -e
29+
sudo groupadd -g 5000 vmail
30+
sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail
31+
sudo cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf
32+
sudo cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass
33+
sudo service dovecot restart
34+
fi

.github/actions/test/action.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test
2+
inputs:
3+
run-tests-parameters:
4+
default: ''
5+
required: false
6+
runs:
7+
using: composite
8+
steps:
9+
- shell: bash
10+
run: |
11+
if [ "$ARCH" != "macos" ]; then
12+
export MYSQL_TEST_USER=root
13+
export MYSQL_TEST_PASSWD=root
14+
export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test"
15+
export PDO_MYSQL_TEST_USER=root
16+
export PDO_MYSQL_TEST_PASS=root
17+
export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0"
18+
export PDO_DBLIB_TEST_USER="pdo_test"
19+
export PDO_DBLIB_TEST_PASS="password"
20+
fi
21+
if [ "$ARCH" == "macos" ]; then
22+
export CI_NO_IPV6=1
23+
fi
24+
export REPORT_EXIT_STATUS=no
25+
export SKIP_IO_CAPTURE_TESTS=1
26+
sapi/cli/php run-tests.php -P -q ${{ inputs.run-tests-parameters }} \
27+
-j$(${{ env.ARCH != 'macos' && '/usr/bin/nproc' || 'sysctl -n hw.logicalcpu' }}) \
28+
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
29+
--offline \
30+
--show-diff \
31+
--show-slow 1000 \
32+
--set-timeout 120

0 commit comments

Comments
 (0)