Skip to content

Commit a5d7fa2

Browse files
authored
Merge pull request #289 from clue-labs/php8.6-v3
[3.x] Run tests on PHP 8.6 and update test environment
2 parents 0b45df3 + 0a7c3e1 commit a5d7fa2

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ on:
77
jobs:
88
PHPUnit:
99
name: PHPUnit (PHP ${{ matrix.php }})
10-
runs-on: ubuntu-24.04
10+
runs-on: ubuntu-26.04
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.6
1415
- 8.5
1516
- 8.4
1617
- 8.3
@@ -22,16 +23,17 @@ jobs:
2223
- 7.2
2324
- 7.1
2425
steps:
25-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v7
2627
- uses: shivammathur/setup-php@v2
2728
with:
2829
php-version: ${{ matrix.php }}
2930
coverage: ${{ matrix.php < 8.0 && 'xdebug' || 'pcov' }}
3031
ini-file: development
3132
ini-values: disable_functions='' # do not disable PCNTL functions on PHP < 8.1
32-
extensions: sockets, pcntl, event, ${{ matrix.php < 8.0 && 'ev-1.1.5' || 'ev' }}
33+
extensions: sockets, pcntl, event, ${{ matrix.php < 8.0 && 'ev-1.1.5' || 'ev-rosmanov/pecl-ev@1.2.4' }}
3334
env:
3435
fail-fast: true # fail step if any extension can not be installed
36+
EV_PATH: . # needed to build ext-ev from git on Ubuntu 26.04, see https://github.com/shivammathur/setup-php/issues/1146
3537
- run: composer install
3638
- run: vendor/bin/phpunit --coverage-text
3739
if: ${{ matrix.php >= 7.3 }}
@@ -40,11 +42,12 @@ jobs:
4042

4143
PHPUnit-Unstable:
4244
name: PHPUnit (Unstable PHP ${{ matrix.php }})
43-
runs-on: ubuntu-24.04
45+
runs-on: ${{ matrix.php >= 8.0 && 'ubuntu-26.04' || 'ubuntu-24.04' }} # legacy extensions do not build on 26.04
4446
continue-on-error: true
4547
strategy:
4648
matrix:
4749
php:
50+
- 8.6
4851
- 8.5
4952
- 8.4
5053
- 8.3
@@ -56,7 +59,7 @@ jobs:
5659
- 7.2
5760
- 7.1
5861
steps:
59-
- uses: actions/checkout@v4
62+
- uses: actions/checkout@v7
6063
- uses: shivammathur/setup-php@v2
6164
with:
6265
php-version: ${{ matrix.php }}
@@ -66,7 +69,7 @@ jobs:
6669
- name: Install ext-uv
6770
run: |
6871
sudo apt-get update -q && sudo apt-get install libuv1-dev
69-
echo "yes" | sudo pecl install ${{ matrix.php >= 8.0 && 'uv-0.3.0' || 'uv-0.2.4' }}
72+
echo "yes" | sudo pecl install ${{ matrix.php >= 8.0 && 'uv-0.3.1' || 'uv-0.2.4' }}
7073
php -m | grep -q uv || echo "extension=uv.so" >> "$(php -r 'echo php_ini_loaded_file();')"
7174
- run: composer install
7275
- run: vendor/bin/phpunit --coverage-text
@@ -81,6 +84,7 @@ jobs:
8184
strategy:
8285
matrix:
8386
php:
87+
- 8.6
8488
- 8.5
8589
- 8.4
8690
- 8.3
@@ -92,7 +96,7 @@ jobs:
9296
- 7.2
9397
- 7.1
9498
steps:
95-
- uses: actions/checkout@v4
99+
- uses: actions/checkout@v7
96100
- uses: shivammathur/setup-php@v2
97101
with:
98102
php-version: ${{ matrix.php }}

‎tests/StreamSelectLoopTest.php‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ public function testStreamSelectTimeoutEmulation()
4040
$this->assertGreaterThan(0.04, $interval);
4141
}
4242

43-
public function testStreamSelectReportsWarningForStreamWithFilter()
43+
public function testStreamSelectReportsWarningForMemoryStream()
4444
{
45-
$stream = tmpfile();
46-
stream_filter_append($stream, 'string.rot13');
45+
$stream = fopen('php://memory', 'r+');
4746

4847
$this->loop->addReadStream($stream, $this->expectCallableNever());
4948

@@ -73,10 +72,9 @@ public function testStreamSelectReportsWarningForStreamWithFilter()
7372
$this->assertEquals($previous, $now);
7473
}
7574

76-
public function testStreamSelectThrowsWhenCustomErrorHandlerThrowsForStreamWithFilter()
75+
public function testStreamSelectThrowsWhenCustomErrorHandlerThrowsForMemoryStream()
7776
{
78-
$stream = tmpfile();
79-
stream_filter_append($stream, 'string.rot13');
77+
$stream = fopen('php://memory', 'r+');
8078

8179
$this->loop->addReadStream($stream, $this->expectCallableNever());
8280

0 commit comments

Comments
 (0)