Skip to content

Commit 4abf461

Browse files
committed
Initial commit
0 parents  commit 4abf461

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-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: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
cd ../
20+
21+
- name: Install dependencies
22+
shell: bash
23+
run: |
24+
set -x
25+
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
26+
sudo apt update
27+
sudo apt build-dep libcurl4-openssl-dev curl -y
28+
29+
- name: Configure build
30+
shell: bash
31+
run: |
32+
set -x
33+
cd .curl
34+
autoreconf -fi
35+
cd ../
36+
37+
- name: Compile
38+
shell: bash
39+
run: |
40+
cd ./.php-src
41+
make -j$(/usr/bin/nproc) >/dev/null
42+
cd ../
43+
44+
- name: Install
45+
shell: bash
46+
run: |
47+
set -x
48+
cd ./.php-src
49+
sudo make install
50+
sudo mkdir -p /etc/php.d
51+
sudo chmod 777 /etc/php.d
52+
cd ../
53+
54+
- name: Enable opcache
55+
shell: bash
56+
run: |
57+
echo zend_extension=opcache.so >> /etc/php.d/opcache.ini
58+
echo opcache.enable=1 >> /etc/php.d/opcache.ini
59+
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
60+
61+
- name: Cleanup
62+
shell: bash
63+
run: |
64+
rm .php-src -Rf

0 commit comments

Comments
 (0)