Skip to content

Commit 940fe27

Browse files
committed
Initial commit
0 parents  commit 940fe27

File tree

4 files changed

+190
-0
lines changed

4 files changed

+190
-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: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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 apt build-dep libcurl4-openssl-dev curl -y
25+
26+
- name: Configure build
27+
shell: bash
28+
run: |
29+
set -x
30+
cd .php-src
31+
./buildconf --force
32+
./configure \
33+
--enable-option-checking=fatal \
34+
--prefix=/usr \
35+
--enable-phpdbg \
36+
--enable-fpm \
37+
--with-pdo-mysql=mysqlnd \
38+
--with-mysqli=mysqlnd \
39+
--with-pgsql \
40+
--with-pdo-pgsql \
41+
--with-pdo-sqlite \
42+
--enable-intl \
43+
--without-pear \
44+
--enable-gd \
45+
--with-jpeg \
46+
--with-webp \
47+
--with-avif \
48+
--with-freetype \
49+
--with-xpm \
50+
--enable-exif \
51+
--with-zip \
52+
--with-zlib \
53+
--enable-soap \
54+
--enable-xmlreader \
55+
--with-xsl \
56+
--with-tidy \
57+
--enable-sysvsem \
58+
--enable-sysvshm \
59+
--enable-shmop \
60+
--enable-pcntl \
61+
--with-readline \
62+
--enable-mbstring \
63+
--with-curl \
64+
--with-gettext \
65+
--enable-sockets \
66+
--with-bz2 \
67+
--with-openssl \
68+
--with-gmp \
69+
--enable-bcmath \
70+
--enable-calendar \
71+
--enable-ftp \
72+
--with-enchant=/usr \
73+
--enable-sysvmsg \
74+
--with-ffi \
75+
--with-ldap \
76+
--with-ldap-sasl \
77+
--with-password-argon2 \
78+
--with-mhash \
79+
--with-sodium \
80+
--enable-dba \
81+
--with-cdb \
82+
--enable-flatfile \
83+
--enable-inifile \
84+
--with-tcadb \
85+
--with-lmdb \
86+
--with-qdbm \
87+
--with-snmp \
88+
--with-unixODBC \
89+
--with-pdo-odbc=unixODBC,/usr \
90+
--with-config-file-path=/etc \
91+
--with-config-file-scan-dir=/etc/php.d \
92+
--with-pdo-dblib \
93+
--enable-werror
94+
cd ../
95+
96+
- name: Compile
97+
shell: bash
98+
run: |
99+
cd ./.php-src
100+
make -j$(/usr/bin/nproc) >/dev/null
101+
cd ../
102+
103+
- name: Install
104+
shell: bash
105+
run: |
106+
set -x
107+
cd ./.php-src
108+
sudo make install
109+
sudo mkdir -p /etc/php.d
110+
sudo chmod 777 /etc/php.d
111+
cd ../
112+
113+
- name: Enable opcache
114+
shell: bash
115+
run: |
116+
echo zend_extension=opcache.so >> /etc/php.d/opcache.ini
117+
echo opcache.enable=1 >> /etc/php.d/opcache.ini
118+
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
119+
120+
- name: Cleanup
121+
shell: bash
122+
run: |
123+
rm .php-src -Rf

0 commit comments

Comments
 (0)