Skip to content

Commit 5cc99a1

Browse files
authored
Merge pull request #97 from SimonFrings/ci
Use GitHub actions for continuous integration (CI)
2 parents d2d8744 + a2ecf61 commit 5cc99a1

File tree

6 files changed

+64
-39
lines changed

6 files changed

+64
-39
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/workflows/ 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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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-20.04
11+
strategy:
12+
matrix:
13+
php:
14+
- 8.0
15+
- 7.4
16+
- 7.3
17+
- 7.2
18+
- 7.1
19+
- 7.0
20+
- 5.6
21+
- 5.5
22+
- 5.4
23+
- 5.3
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
coverage: xdebug
30+
- run: composer install
31+
- run: vendor/bin/phpunit --coverage-text
32+
if: ${{ matrix.php >= 7.3 }}
33+
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
34+
if: ${{ matrix.php < 7.3 }}
35+
36+
PHPUnit-hhvm:
37+
name: PHPUnit (HHVM)
38+
runs-on: ubuntu-18.04
39+
continue-on-error: true
40+
steps:
41+
- uses: actions/checkout@v2
42+
- uses: azjezz/setup-hhvm@v1
43+
with:
44+
version: lts-3.30
45+
- run: hhvm $(which composer) require phpunit/phpunit:^5 --dev --no-interaction
46+
- run: hhvm $(which composer) install
47+
- run: hhvm vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/vendor
1+
/vendor/
22
/composer.lock

.travis.yml

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

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# clue/reactphp-socks [![Build Status](https://travis-ci.org/clue/reactphp-socks.svg?branch=master)](https://travis-ci.org/clue/reactphp-socks)
1+
# clue/reactphp-socks
2+
3+
[![CI status](https://github.com/clue/reactphp-socks/workflows/CI/badge.svg)](https://github.com/clue/reactphp-socks/actions)
24

35
Async SOCKS proxy connector client and server implementation, tunnel any TCP/IP-based
46
protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of
@@ -1025,7 +1027,7 @@ $ composer require clue/socks-react:^1.2
10251027
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
10261028

10271029
This project aims to run on any platform and thus does not require any PHP
1028-
extensions and supports running on legacy PHP 5.3 through current PHP 7+ and
1030+
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and
10291031
HHVM.
10301032
It's *highly recommended to use PHP 7+* for this project.
10311033

tests/FunctionalTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public function setUpClientServer()
4444
/** @group internet */
4545
public function testConnection()
4646
{
47+
// max_nesting_level was set to 100 for PHP Versions < 5.4 which resulted in failing test for legacy PHP
48+
ini_set('xdebug.max_nesting_level', 256);
49+
4750
$this->assertResolveStream($this->client->connect('www.google.com:80'));
4851
}
4952

@@ -92,8 +95,8 @@ public function testConnectionSocks5()
9295
/** @group internet */
9396
public function testConnectionSocksOverTls()
9497
{
95-
if (!function_exists('stream_socket_enable_crypto')) {
96-
$this->markTestSkipped('Required function does not exist in your environment (HHVM?)');
98+
if (defined('HHVM_VERSION')) {
99+
$this->markTestSkipped('Not supported on HHVM');
97100
}
98101

99102
$socket = new \React\Socket\Server('tls://127.0.0.1:0', $this->loop, array('tls' => array(
@@ -117,8 +120,8 @@ public function testConnectionSocksOverTls()
117120
*/
118121
public function testConnectionSocksOverTlsUsesPeerNameFromSocksUri()
119122
{
120-
if (!function_exists('stream_socket_enable_crypto')) {
121-
$this->markTestSkipped('Required function does not exist in your environment (HHVM?)');
123+
if (defined('HHVM_VERSION')) {
124+
$this->markTestSkipped('Not supported on HHVM');
122125
}
123126

124127
$socket = new \React\Socket\Server('tls://127.0.0.1:0', $this->loop, array('tls' => array(
@@ -421,8 +424,8 @@ public function testConnectorInvalidUnboundPortTimeout()
421424
/** @group internet */
422425
public function testSecureConnectorOkay()
423426
{
424-
if (!function_exists('stream_socket_enable_crypto')) {
425-
$this->markTestSkipped('Required function does not exist in your environment (HHVM?)');
427+
if (defined('HHVM_VERSION')) {
428+
$this->markTestSkipped('Not supported on HHVM');
426429
}
427430

428431
$ssl = new SecureConnector($this->client, $this->loop);
@@ -445,8 +448,8 @@ public function testSecureConnectorToBadSslWithVerifyFails()
445448
/** @group internet */
446449
public function testSecureConnectorToBadSslWithoutVerifyWorks()
447450
{
448-
if (!function_exists('stream_socket_enable_crypto')) {
449-
$this->markTestSkipped('Required function does not exist in your environment (HHVM?)');
451+
if (defined('HHVM_VERSION')) {
452+
$this->markTestSkipped('Not supported on HHVM');
450453
}
451454

452455
$ssl = new SecureConnector($this->client, $this->loop, array('verify_peer' => false));

0 commit comments

Comments
 (0)