Skip to content

Commit 1854d5d

Browse files
committed
Use GitHub actions for continuous integration (CI)
Bye bye Travis CI, you've served us well.
1 parent 1a709e2 commit 1854d5d

File tree

6 files changed

+84
-94
lines changed

6 files changed

+84
-94
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/.gitattributes export-ignore
2+
/.github/ export-ignore
23
/.gitignore export-ignore
3-
/.travis.yml export-ignore
44
/examples export-ignore
55
/phpunit.xml.dist export-ignore
66
/phpunit.xml.legacy export-ignore

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
PHPUnit:
9+
name: PHPUnit (PHP ${{ matrix.php }})
10+
runs-on: ubuntu-18.04 # legacy Ubuntu 18.04 for legacy libevent
11+
strategy:
12+
matrix:
13+
php:
14+
- 7.4
15+
- 7.3
16+
- 7.2
17+
- 7.1
18+
- 7.0
19+
- 5.6
20+
- 5.5
21+
- 5.4
22+
- 5.3
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
coverage: xdebug
29+
- 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
34+
- run: composer install
35+
- run: vendor/bin/phpunit --coverage-text
36+
if: ${{ matrix.php >= 7.3 }}
37+
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
38+
if: ${{ matrix.php < 7.3 }}
39+
40+
PHPUnit-Windows:
41+
name: PHPUnit (PHP ${{ matrix.php }} on Windows)
42+
runs-on: windows-2019
43+
continue-on-error: true
44+
strategy:
45+
matrix:
46+
php:
47+
- 7.4
48+
- 7.3
49+
- 7.2
50+
- 7.1
51+
steps:
52+
- uses: actions/checkout@v2
53+
- uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
coverage: xdebug
57+
extensions: sockets,event # future: add uv-beta (installs, but can not load)
58+
- run: composer install
59+
- run: vendor/bin/phpunit --coverage-text
60+
if: ${{ matrix.php >= 7.3 }}
61+
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
62+
if: ${{ matrix.php < 7.3 }}
63+
64+
PHPUnit-hhvm:
65+
name: PHPUnit (HHVM)
66+
runs-on: ubuntu-18.04
67+
continue-on-error: true
68+
steps:
69+
- uses: actions/checkout@v2
70+
- uses: azjezz/setup-hhvm@v1
71+
with:
72+
version: lts-3.30
73+
- run: hhvm $(which composer) install
74+
- run: hhvm vendor/bin/phpunit

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
composer.lock
2-
phpunit.xml
3-
vendor
1+
/composer.lock
2+
/phpunit.xml
3+
/vendor/

.travis.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# EventLoop Component
22

3-
[![Build Status](https://travis-ci.org/reactphp/event-loop.svg?branch=master)](https://travis-ci.org/reactphp/event-loop)
3+
[![CI status](https://github.com/reactphp/event-loop/workflows/CI/badge.svg)](https://github.com/reactphp/event-loop/actions)
44

55
[ReactPHP](https://reactphp.org/)'s core reactor event loop that libraries can use for evented I/O.
66

travis-init.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ set -o pipefail
66
if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]]; then
77
echo "yes" | pecl install event
88
echo "yes" | pecl install ev
9+
if ! [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
10+
echo "extension=event.so" >> "$(php -r 'echo php_ini_loaded_file();')"
11+
echo "extension=ev.so" >> "$(php -r 'echo php_ini_loaded_file();')"
12+
fi
913
fi
1014

1115
# install 'libevent' PHP extension on legacy PHP 5 only
@@ -35,4 +39,5 @@ fi
3539
# install 'libuv' PHP extension on PHP 7+ only
3640
if ! [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
3741
echo "yes" | pecl install uv-beta
42+
echo "extension=uv.so" >> "$(php -r 'echo php_ini_loaded_file();')"
3843
fi

0 commit comments

Comments
 (0)