Skip to content

Commit 534e595

Browse files
committed
Add initial action
1 parent dd81ec9 commit 534e595

File tree

3 files changed

+214
-0
lines changed

3 files changed

+214
-0
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Tests
2+
permissions: read-all
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
name: Compile and install PHP - Test
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup PHP
15+
uses: PHPWatch/compile-php
16+
17+
- name: Display versions and env
18+
run: |
19+
php -v
20+
php -m
21+

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Compile PHP - GitHub Actions
2+
3+
This GitHub action downloads the latest PHP source (php/php-src),
4+
configures it to enable all extensions, compiles it, and installs it.
5+
6+
## Usage
7+
8+
```yaml
9+
name: Tests
10+
permissions: read-all
11+
on:
12+
pull_request:
13+
push:
14+
15+
jobs:
16+
run:
17+
runs-on: ubuntu-latest
18+
name: Compile and install PHP - Test
19+
steps:
20+
- name: Setup PHP
21+
uses: PHPWatch/compile-php
22+
23+
- name: Display versions and env
24+
run: |
25+
php -v
26+
php -m
27+
28+
29+
```

action.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: Compile and install PHP from source
2+
description: Compile and install PHP from source
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Checkout php-src repo
7+
uses: actions/checkout@v4
8+
with:
9+
repository: php/php-src
10+
path: .php-src
11+
12+
- name: Install dependencies
13+
shell: bash
14+
run: |
15+
set -x
16+
17+
export DEBIAN_FRONTEND=noninteractive
18+
19+
sudo apt update -y | true
20+
sudo apt install -y \
21+
autoconf \
22+
gcc \
23+
make \
24+
curl \
25+
unzip \
26+
bison \
27+
re2c \
28+
locales \
29+
ldap-utils \
30+
openssl \
31+
slapd \
32+
language-pack-de \
33+
libgmp-dev \
34+
libicu-dev \
35+
libtidy-dev \
36+
libenchant-2-dev \
37+
libbz2-dev \
38+
libsasl2-dev \
39+
libxpm-dev \
40+
libzip-dev \
41+
libsqlite3-dev \
42+
libsqlite3-mod-spatialite \
43+
libwebp-dev \
44+
libonig-dev \
45+
libcurl4-openssl-dev \
46+
libxml2-dev \
47+
libxslt1-dev \
48+
libpq-dev \
49+
libreadline-dev \
50+
libldap2-dev \
51+
libsodium-dev \
52+
libargon2-0-dev \
53+
libmm-dev \
54+
libsnmp-dev \
55+
snmpd \
56+
snmp-mibs-downloader \
57+
freetds-dev \
58+
unixodbc-dev \
59+
llvm \
60+
clang \
61+
sendmail \
62+
firebird-dev \
63+
liblmdb-dev \
64+
libtokyocabinet-dev \
65+
libdb-dev \
66+
libqdbm-dev \
67+
libjpeg-dev \
68+
libpng-dev \
69+
libfreetype6-dev
70+
cd ..
71+
72+
- name: Configure build
73+
shell: bash
74+
run: |
75+
set -x
76+
cd .php-src
77+
./buildconf --force
78+
./configure \
79+
--enable-option-checking=fatal \
80+
--prefix=/usr \
81+
--enable-phpdbg \
82+
--enable-fpm \
83+
--with-pdo-mysql=mysqlnd \
84+
--with-mysqli=mysqlnd \
85+
--with-pgsql \
86+
--with-pdo-pgsql \
87+
--with-pdo-sqlite \
88+
--enable-intl \
89+
--without-pear \
90+
--enable-gd \
91+
--with-jpeg \
92+
--with-webp \
93+
--with-freetype \
94+
--with-xpm \
95+
--enable-exif \
96+
--with-zip \
97+
--with-zlib \
98+
--enable-soap \
99+
--enable-xmlreader \
100+
--with-xsl \
101+
--with-tidy \
102+
--enable-sysvsem \
103+
--enable-sysvshm \
104+
--enable-shmop \
105+
--enable-pcntl \
106+
--with-readline \
107+
--enable-mbstring \
108+
--with-curl \
109+
--with-gettext \
110+
--enable-sockets \
111+
--with-bz2 \
112+
--with-openssl \
113+
--with-gmp \
114+
--enable-bcmath \
115+
--enable-calendar \
116+
--enable-ftp \
117+
--with-enchant=/usr \
118+
--enable-sysvmsg \
119+
--with-ffi \
120+
--enable-zend-test \
121+
--enable-dl-test=shared \
122+
--with-ldap \
123+
--with-ldap-sasl \
124+
--with-password-argon2 \
125+
--with-mhash \
126+
--with-sodium \
127+
--enable-dba \
128+
--with-cdb \
129+
--enable-flatfile \
130+
--enable-inifile \
131+
--with-tcadb \
132+
--with-lmdb \
133+
--with-qdbm \
134+
--with-snmp \
135+
--with-unixODBC \
136+
--with-pdo-odbc=unixODBC,/usr \
137+
--with-config-file-path=/etc \
138+
--with-config-file-scan-dir=/etc/php.d \
139+
--with-pdo-firebird \
140+
--with-pdo-dblib \
141+
--enable-werror
142+
cd ../
143+
144+
- name: Compile
145+
shell: bash
146+
run: |
147+
cd ./.php-src
148+
make -j$(/usr/bin/nproc)
149+
cd ../
150+
151+
- name: Install
152+
shell: bash
153+
run: |
154+
set -x
155+
cd ./.php-src
156+
sudo make install
157+
sudo mkdir -p /etc/php.d
158+
sudo chmod 777 /etc/php.d
159+
cd ../
160+
161+
- name: Cleanup
162+
shell: bash
163+
run: |
164+
rm .php-src

0 commit comments

Comments
 (0)