Skip to content

Commit e25cdc4

Browse files
committed
Initial commit
0 parents  commit e25cdc4

File tree

4 files changed

+192
-0
lines changed

4 files changed

+192
-0
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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/setup-curl@main
16+
17+
- name: Display versions and env
18+
run: |
19+
curl --version

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 PHP Watch
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Compile PHP - GitHub Actions
2+
3+
This GitHub action downloads the latest Curl release (curl),
4+
configures it to enable all features, 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/setup-curl@main
22+
23+
- name: Display versions and env
24+
run: |
25+
curl --version
26+
27+
```

action.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Compile and install Curl from source
2+
description: Compile and install Curl from source
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Checkout php-src repo
7+
uses: actions/checkout@v4
8+
with:
9+
repository: curl/curl
10+
path: .curl
11+
fetch-depth: 0
12+
13+
- name: Checkout latest release tag
14+
shell: bash
15+
run: |
16+
cd .curl
17+
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
18+
git checkout $LATEST_TAG
19+
20+
- name: Install dependencies
21+
shell: bash
22+
run: |
23+
set -x
24+
sudo sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list && sudo sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list
25+
sudo apt update
26+
sudo apt build-dep libcurl4-openssl-dev curl -y
27+
28+
- name: Configure build
29+
shell: bash
30+
run: |
31+
set -x
32+
cd .php-src
33+
./buildconf --force
34+
./configure \
35+
--enable-option-checking=fatal \
36+
--prefix=/usr \
37+
--enable-phpdbg \
38+
--enable-fpm \
39+
--with-pdo-mysql=mysqlnd \
40+
--with-mysqli=mysqlnd \
41+
--with-pgsql \
42+
--with-pdo-pgsql \
43+
--with-pdo-sqlite \
44+
--enable-intl \
45+
--without-pear \
46+
--enable-gd \
47+
--with-jpeg \
48+
--with-webp \
49+
--with-avif \
50+
--with-freetype \
51+
--with-xpm \
52+
--enable-exif \
53+
--with-zip \
54+
--with-zlib \
55+
--enable-soap \
56+
--enable-xmlreader \
57+
--with-xsl \
58+
--with-tidy \
59+
--enable-sysvsem \
60+
--enable-sysvshm \
61+
--enable-shmop \
62+
--enable-pcntl \
63+
--with-readline \
64+
--enable-mbstring \
65+
--with-curl \
66+
--with-gettext \
67+
--enable-sockets \
68+
--with-bz2 \
69+
--with-openssl \
70+
--with-gmp \
71+
--enable-bcmath \
72+
--enable-calendar \
73+
--enable-ftp \
74+
--with-enchant=/usr \
75+
--enable-sysvmsg \
76+
--with-ffi \
77+
--with-ldap \
78+
--with-ldap-sasl \
79+
--with-password-argon2 \
80+
--with-mhash \
81+
--with-sodium \
82+
--enable-dba \
83+
--with-cdb \
84+
--enable-flatfile \
85+
--enable-inifile \
86+
--with-tcadb \
87+
--with-lmdb \
88+
--with-qdbm \
89+
--with-snmp \
90+
--with-unixODBC \
91+
--with-pdo-odbc=unixODBC,/usr \
92+
--with-config-file-path=/etc \
93+
--with-config-file-scan-dir=/etc/php.d \
94+
--with-pdo-dblib \
95+
--enable-werror
96+
cd ../
97+
98+
- name: Compile
99+
shell: bash
100+
run: |
101+
cd ./.php-src
102+
make -j$(/usr/bin/nproc) >/dev/null
103+
cd ../
104+
105+
- name: Install
106+
shell: bash
107+
run: |
108+
set -x
109+
cd ./.php-src
110+
sudo make install
111+
sudo mkdir -p /etc/php.d
112+
sudo chmod 777 /etc/php.d
113+
cd ../
114+
115+
- name: Enable opcache
116+
shell: bash
117+
run: |
118+
echo zend_extension=opcache.so >> /etc/php.d/opcache.ini
119+
echo opcache.enable=1 >> /etc/php.d/opcache.ini
120+
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
121+
122+
- name: Cleanup
123+
shell: bash
124+
run: |
125+
rm .php-src -Rf

0 commit comments

Comments
 (0)