Skip to content

Commit 0322d2c

Browse files
committed
Clean up CI config to simplify installing PHP extensions
1 parent 129d996 commit 0322d2c

File tree

3 files changed

+42
-50
lines changed

3 files changed

+42
-50
lines changed

.gitattributes

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/.gitattributes export-ignore
22
/.github/ export-ignore
33
/.gitignore export-ignore
4-
/examples export-ignore
4+
/examples/ export-ignore
55
/phpunit.xml.dist export-ignore
66
/phpunit.xml.legacy export-ignore
7-
/tests export-ignore
8-
/travis-init.sh export-ignore
7+
/tests/ export-ignore

.github/workflows/ci.yml

+40-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,46 @@ jobs:
2727
php-version: ${{ matrix.php }}
2828
coverage: xdebug
2929
- run: sudo apt-get update && sudo apt-get install libevent-dev
30-
- run: sudo add-apt-repository ppa:ondrej/php -y && sudo apt-get update -q && sudo apt-get install libuv1-dev
31-
if: ${{ matrix.php >= 5.6 }}
32-
- run: sudo sh -c "TRAVIS_PHP_VERSION=${{ matrix.php }} ./travis-init.sh"
33-
if: ${{ matrix.php != 7.0 }} # exclude flaky PHP 7.0 build
30+
- name: Install ext-event on PHP >= 5.4
31+
run: |
32+
echo "yes" | sudo pecl install event
33+
# explicitly enable extensions in php.ini on PHP 5.6+
34+
php -r 'exit((int)(PHP_VERSION_ID >= 50600));' || echo "extension=event.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')"
35+
if: ${{ matrix.php >= 5.4 }}
36+
- name: Install ext-ev on PHP >= 5.4
37+
run: |
38+
echo "yes" | sudo pecl install ev
39+
# explicitly enable extensions in php.ini on PHP 5.6+
40+
php -r 'exit((int)(PHP_VERSION_ID >= 50600));' || echo "extension=ev.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')"
41+
if: ${{ matrix.php >= 5.4 }}
42+
- name: Install ext-uv on PHP >= 7.0
43+
run: |
44+
sudo add-apt-repository ppa:ondrej/php -y && sudo apt-get update -q && sudo apt-get install libuv1-dev
45+
echo "yes" | sudo pecl install uv-beta
46+
echo "extension=uv.so" >> "$(php -r 'echo php_ini_loaded_file();')"
47+
if: ${{ matrix.php >= 7.0 }}
48+
- name: Install legacy ext-libevent on PHP < 7.0
49+
run: |
50+
curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz
51+
pushd libevent-0.1.0
52+
phpize
53+
./configure
54+
make
55+
sudo make install
56+
popd
57+
echo "extension=libevent.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')"
58+
if: ${{ matrix.php < 7.0 }}
59+
- name: Install legacy ext-libev on PHP < 7.0
60+
run: |
61+
git clone --recursive https://github.com/m4rw3r/php-libev
62+
pushd php-libev
63+
phpize
64+
./configure --with-libev
65+
make
66+
sudo make install
67+
popd
68+
echo "extension=libev.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')"
69+
if: ${{ matrix.php < 7.0 }}
3470
- run: composer install
3571
- run: vendor/bin/phpunit --coverage-text
3672
if: ${{ matrix.php >= 7.3 }}

travis-init.sh

-43
This file was deleted.

0 commit comments

Comments
 (0)