Skip to content

Commit 2859a8c

Browse files
authored
Merge pull request #157 from SimonFrings/ci
Use GitHub actions for continuous integration (CI)
2 parents c459d2e + fb4cf11 commit 2859a8c

File tree

8 files changed

+83
-47
lines changed

8 files changed

+83
-47
lines changed

.gitattributes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/.gitattributes export-ignore
2+
/.github/ export-ignore
23
/.gitignore export-ignore
3-
/.travis.yml 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
7+
/tests/ export-ignore

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
- run: time php examples/91-benchmark-throughput.php
36+
37+
PHPUnit-macOS:
38+
name: PHPUnit (macOS)
39+
runs-on: macos-10.15
40+
continue-on-error: true
41+
steps:
42+
- uses: actions/checkout@v2
43+
- uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: 8.0
46+
coverage: xdebug
47+
- run: composer install
48+
- run: vendor/bin/phpunit --coverage-text
49+
- run: time php examples/91-benchmark-throughput.php
50+
51+
PHPUnit-hhvm:
52+
name: PHPUnit (HHVM)
53+
runs-on: ubuntu-18.04
54+
continue-on-error: true
55+
steps:
56+
- uses: actions/checkout@v2
57+
- uses: azjezz/setup-hhvm@v1
58+
with:
59+
version: lts-3.30
60+
- run: hhvm $(which composer) install
61+
- run: hhvm vendor/bin/phpunit
62+
- run: time php examples/91-benchmark-throughput.php

.gitignore

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

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Stream
22

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

55
Event-driven readable and writable streams for non-blocking I/O in [ReactPHP](https://reactphp.org/).
66

@@ -1185,7 +1185,7 @@ $ composer require react/stream:^1.1.1
11851185
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
11861186

11871187
This project aims to run on any platform and thus does not require any PHP
1188-
extensions and supports running on legacy PHP 5.3 through current PHP 7+ and HHVM.
1188+
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM.
11891189
It's *highly recommended to use PHP 7+* for this project due to its vast
11901190
performance improvements.
11911191

tests/FunctionalInternetTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testUploadBiggerBlockPlain()
5959
public function testUploadKilobyteSecure()
6060
{
6161
$size = 1000;
62-
$stream = stream_socket_client('tls://httpbin.org:443');
62+
$stream = stream_socket_client('ssl://httpbin.org:443');
6363

6464
$loop = Factory::create();
6565
$stream = new DuplexResourceStream($stream, $loop);
@@ -85,7 +85,7 @@ public function testUploadBiggerBlockSecure()
8585
// a bit to trigger different behavior on Linux vs Mac OS X.
8686
$size = 136 * 1000;
8787

88-
$stream = stream_socket_client('tls://httpbin.org:443');
88+
$stream = stream_socket_client('ssl://httpbin.org:443');
8989

9090
// PHP < 7.1.4 (and PHP < 7.0.18) suffers from a bug when writing big
9191
// chunks of data over TLS streams at once.

tests/TestCase.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,15 @@ public function assertContainsStringIgnoringCase($needle, $haystack)
8686
$this->assertContains($needle, $haystack, '', true);
8787
}
8888
}
89+
90+
public function assertSameIgnoringCase($expected, $actual)
91+
{
92+
if (method_exists($this, 'assertEqualsIgnoringCase')) {
93+
// PHPUnit 7.5+
94+
$this->assertEqualsIgnoringCase($expected, $actual);
95+
} else {
96+
// legacy PHPUnit 4 - PHPUnit 7.5
97+
$this->assertSame($expected, $actual);
98+
}
99+
}
89100
}

tests/WritableResourceStreamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public function testWritingToClosedStream()
485485
$buffer->handleWrite();
486486

487487
$this->assertInstanceOf('Exception', $error);
488-
$this->assertSame('Unable to write to stream: fwrite(): send of 3 bytes failed with errno=32 Broken pipe', $error->getMessage());
488+
$this->assertSameIgnoringCase('Unable to write to stream: fwrite(): send of 3 bytes failed with errno=32 Broken pipe', $error->getMessage());
489489
}
490490

491491
private function createWriteableLoopMock()

0 commit comments

Comments
 (0)