8000 Use GitHub actions for continuous integration (CI) by clue · Pull Request #230 · reactphp/event-loop · GitHub
[go: up one dir, main page]

Skip to content

Use GitHub actions for continuous integration (CI) #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use GitHub actions for continuous integration (CI)
Bye bye Travis CI, you've served us well.
  • Loading branch information
clue committed Jun 29, 2021
commit 1854d5dac3e687184ab2e2c75c65728f915991f6
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/examples export-ignore
/phpunit.xml.dist export-ignore
/phpunit.xml.legacy export-ignore
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
push:
pull_request:

jobs:
PHPUnit:
name: PHPUnit (PHP ${{ matrix.php }})
runs-on: ubuntu-18.04 # legacy Ubuntu 18.04 for legacy libevent
strategy:
matrix:
php:
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
- 5.6
- 5.5
- 5.4
- 5.3
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
- run: sudo apt-get update && sudo apt-get install libevent-dev
- run: sudo add-apt-repository ppa:ondrej/php -y && sudo apt-get update -q && sudo apt-get install libuv1-dev
if: ${{ matrix.php >= 5.6 }}
- run: sudo sh -c "TRAVIS_PHP_VERSION=${{ matrix.php }} ./travis-init.sh"
if: ${{ matrix.php != 7.0 }} # exclude flaky PHP 7.0 build
- run: composer install
- run: vendor/bin/phpunit --coverage-text
if: ${{ matrix.php >= 7.3 }}
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
if: ${{ matrix.php < 7.3 }}

PHPUnit-Windows:
name: PHPUnit (PHP ${{ matrix.php }} on Windows)
runs-on: windows-2019
continue-on-error: true
strategy:
matrix:
php:
- 7.4
- 7.3
- 7.2
- 7.1
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
extensions: sockets,event # future: add uv-beta (installs, but can not load)
- run: composer install
- run: vendor/bin/phpunit --coverage-text
if: ${{ matrix.php >= 7.3 }}
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
if: ${{ matrix.php < 7.3 }}

PHPUnit-hhvm:
name: PHPUnit (HHVM)
runs-on: ubuntu-18.04
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: azjezz/setup-hhvm@v1
with:
version: lts-3.30
- run: hhvm $(which composer) install
- run: hhvm vendor/bin/phpunit
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
composer.lock
phpunit.xml
vendor
/composer.lock
/phpunit.xml
/vendor/
89 changes: 0 additions & 89 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EventLoop Component

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

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

< AED9 /td>
Expand Down
5 changes: 5 additions & 0 deletions travis-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ set -o pipefail
if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]]; then
echo "yes" | pecl install event
echo "yes" | pecl install ev
if ! [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
echo "extension=event.so" >> "$(php -r 'echo php_ini_loaded_file();')"
echo "extension=ev.so" >> "$(php -r 'echo php_ini_loaded_file();')"
fi
fi

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