Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayesh committed Nov 15, 2024
0 parents commit 40aae8d
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
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
21 changes: 21 additions & 0 deletions LICENSE
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.
27 changes: 27 additions & 0 deletions README.md
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
```
114 changes: 114 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Compile and install Curl from source
description: Compile and install Curl from source
runs:
using: composite
steps:

- name: Show existing env
shell: bash
run: |
curl --version
- 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
cd ../
- 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
sudo apt install iconv
- name: Configure build
shell: bash
run: |
set -x
cd .curl
autoreconf -fi
./configure --disable-symbol-hiding --enable-versioned-symbols \
--enable-threaded-resolver --with-lber-lib=lber \
--enable-websockets \
--with-gssapi=/usr --with-nghttp2 \
--includedir=/usr/include/$(DEB_HOST_MULTIARCH) \
--with-zsh-functions-dir=/usr/share/zsh/vendor-completions \
--with-fish-functions-dir=/usr/share/fish/vendor_completions.d \
--with-ca-path=/etc/ssl/certs \
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
--without-libssh --with-libssh2 \
--with-openssl \
--enable-http \
--enable-ftp \
--enable-file \
--enable-ipfs \
--enable-ldap \
--enable-ldaps \
--enable-rtsp \
--enable-proxy \
--enable-dict \
--enable-telnet \
--enable-tftp \
--enable-pop3 \
--enable-imap \
--enable-smb \
--enable-smtp \
--enable-gopher \
--enable-mqtt \
--enable-manual \
--enable-docs \
--enable-ipv6 \
--enable-pthreads \
--enable-verbose \
--enable-sspi \
--enable-basic-auth \
--enable-bearer-auth \
--enable-digest-auth \
--enable-kerberos-auth \
--enable-negotiate-auth \
--enable-aws \
--enable-ntlm \
--enable-tls-srp \
--enable-unix-sockets \
--enable-cookies \
--enable-socketpair \
--enable-http-auth
cd ../

- name: Compile
shell: bash
run: |
cd ./.curl
make -j$(/usr/bin/nproc) >/dev/null
cd ../
- name: Install
shell: bash
run: |
set -x
cd ./.curl
sudo make install
cd ../
- name: Enable opcache
shell: bash
run: |
curl --version
- name: Cleanup
shell: bash
run: |
rm .curl -Rf

0 comments on commit 40aae8d

Please sign in to comment.