-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e25cdc4
Showing
4 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Tests | ||
permissions: read-all | ||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
name: Compile and install PHP - Test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: PHPWatch/setup-curl@main | ||
|
||
- name: Display versions and env | ||
run: | | ||
curl --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 PHP Watch | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Compile PHP - GitHub Actions | ||
|
||
This GitHub action downloads the latest Curl release (curl), | ||
configures it to enable all features, compiles it, and installs it. | ||
|
||
## Usage | ||
|
||
```yaml | ||
name: Tests | ||
permissions: read-all | ||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
name: Compile and install PHP - Test | ||
steps: | ||
- name: Setup PHP | ||
uses: PHPWatch/setup-curl@main | ||
|
||
- name: Display versions and env | ||
run: | | ||
curl --version | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: Compile and install Curl from source | ||
description: Compile and install Curl from source | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout php-src repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: curl/curl | ||
path: .curl | ||
fetch-depth: 0 | ||
|
||
- name: Checkout latest release tag | ||
shell: bash | ||
run: | | ||
cd .curl | ||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
git checkout $LATEST_TAG | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
set -x | ||
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 | ||
sudo apt update | ||
sudo apt build-dep libcurl4-openssl-dev curl -y | ||
- name: Configure build | ||
shell: bash | ||
run: | | ||
set -x | ||
cd .php-src | ||
./buildconf --force | ||
./configure \ | ||
--enable-option-checking=fatal \ | ||
--prefix=/usr \ | ||
--enable-phpdbg \ | ||
--enable-fpm \ | ||
--with-pdo-mysql=mysqlnd \ | ||
--with-mysqli=mysqlnd \ | ||
--with-pgsql \ | ||
--with-pdo-pgsql \ | ||
--with-pdo-sqlite \ | ||
--enable-intl \ | ||
--without-pear \ | ||
--enable-gd \ | ||
--with-jpeg \ | ||
--with-webp \ | ||
--with-avif \ | ||
--with-freetype \ | ||
--with-xpm \ | ||
--enable-exif \ | ||
--with-zip \ | ||
--with-zlib \ | ||
--enable-soap \ | ||
--enable-xmlreader \ | ||
--with-xsl \ | ||
--with-tidy \ | ||
--enable-sysvsem \ | ||
--enable-sysvshm \ | ||
--enable-shmop \ | ||
--enable-pcntl \ | ||
--with-readline \ | ||
--enable-mbstring \ | ||
--with-curl \ | ||
--with-gettext \ | ||
--enable-sockets \ | ||
--with-bz2 \ | ||
--with-openssl \ | ||
--with-gmp \ | ||
--enable-bcmath \ | ||
--enable-calendar \ | ||
--enable-ftp \ | ||
--with-enchant=/usr \ | ||
--enable-sysvmsg \ | ||
--with-ffi \ | ||
--with-ldap \ | ||
--with-ldap-sasl \ | ||
--with-password-argon2 \ | ||
--with-mhash \ | ||
--with-sodium \ | ||
--enable-dba \ | ||
--with-cdb \ | ||
--enable-flatfile \ | ||
--enable-inifile \ | ||
--with-tcadb \ | ||
--with-lmdb \ | ||
--with-qdbm \ | ||
--with-snmp \ | ||
--with-unixODBC \ | ||
--with-pdo-odbc=unixODBC,/usr \ | ||
--with-config-file-path=/etc \ | ||
--with-config-file-scan-dir=/etc/php.d \ | ||
--with-pdo-dblib \ | ||
--enable-werror | ||
cd ../ | ||
- name: Compile | ||
shell: bash | ||
run: | | ||
cd ./.php-src | ||
make -j$(/usr/bin/nproc) >/dev/null | ||
cd ../ | ||
- name: Install | ||
shell: bash | ||
run: | | ||
set -x | ||
cd ./.php-src | ||
sudo make install | ||
sudo mkdir -p /etc/php.d | ||
sudo chmod 777 /etc/php.d | ||
cd ../ | ||
- name: Enable opcache | ||
shell: bash | ||
run: | | ||
echo zend_extension=opcache.so >> /etc/php.d/opcache.ini | ||
echo opcache.enable=1 >> /etc/php.d/opcache.ini | ||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini | ||
- name: Cleanup | ||
shell: bash | ||
run: | | ||
rm .php-src -Rf |