Skip to content

Commit 6cf805a

Browse files
authored
Merge pull request #288 from clue-labs/php8.6-v1
[1.x] Run tests on PHP 8.6 and update test environment
2 parents 4751c44 + ebd3532 commit 6cf805a

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 11 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
@@ -27,16 +28,17 @@ jobs:
2728
- 5.4
2829
- 5.3
2930
steps:
30-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v7
3132
- uses: shivammathur/setup-php@v2
3233
with:
3334
php-version: ${{ matrix.php }}
3435
coverage: xdebug
3536
ini-file: development
3637
ini-values: disable_functions='' # do not disable PCNTL functions on PHP < 8.1
37-
extensions: sockets, pcntl ${{ matrix.php >= 5.6 && ', event' || '' }} ${{ matrix.php >= 5.4 && (matrix.php < 8.0 && ', ev-1.1.5' || ', ev') || '' }}
38+
extensions: sockets, pcntl ${{ matrix.php >= 5.6 && ', event' || '' }} ${{ matrix.php >= 5.4 && (matrix.php < 8.0 && ', ev-1.1.5' || ', ev-rosmanov/pecl-ev@1.2.4') || '' }}
3839
env:
3940
fail-fast: true # fail step if any extension can not be installed
41+
EV_PATH: . # needed to build ext-ev from git on Ubuntu 26.04, see https://github.com/shivammathur/setup-php/issues/1146
4042
- run: composer install
4143
- run: vendor/bin/phpunit --coverage-text
4244
if: ${{ matrix.php >= 7.3 }}
@@ -45,11 +47,12 @@ jobs:
4547

4648
PHPUnit-Unstable:
4749
name: PHPUnit (Unstable PHP ${{ matrix.php }})
48-
runs-on: ubuntu-22.04
50+
runs-on: ${{ matrix.php >= 8.0 && 'ubuntu-26.04' || 'ubuntu-24.04' }} # legacy extensions do not build on 26.04
4951
continue-on-error: true
5052
strategy:
5153
matrix:
5254
php:
55+
- 8.6
5356
- 8.5
5457
- 8.4
5558
- 8.3
@@ -66,7 +69,7 @@ jobs:
6669
- 5.4
6770
- 5.3
6871
steps:
69-
- uses: actions/checkout@v4
72+
- uses: actions/checkout@v7
7073
- uses: shivammathur/setup-php@v2
7174
with:
7275
php-version: ${{ matrix.php }}
@@ -76,7 +79,7 @@ jobs:
7679
- name: Install ext-uv on PHP 7+
7780
run: |
7881
sudo apt-get update -q && sudo apt-get install libuv1-dev
79-
echo "yes" | sudo pecl install ${{ matrix.php >= 8.0 && 'uv-0.3.0' || 'uv-0.2.4' }}
82+
echo "yes" | sudo pecl install ${{ matrix.php >= 8.0 && 'uv-0.3.1' || 'uv-0.2.4' }}
8083
php -m | grep -q uv || echo "extension=uv.so" >> "$(php -r 'echo php_ini_loaded_file();')"
8184
if: ${{ matrix.php >= 7.0 }}
8285
- name: Install legacy ext-libevent on PHP < 7.0
@@ -89,7 +92,7 @@ jobs:
8992
make
9093
sudo make install
9194
popd
92-
echo "extension=libevent.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')"
95+
echo "extension=libevent.so" | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/99-libevent.ini" # load after ext-sockets
9396
if: ${{ matrix.php < 7.0 }}
9497
- name: Install legacy ext-libev on PHP < 7.0
9598
run: |
@@ -100,7 +103,7 @@ jobs:
100103
make
101104
sudo make install
102105
popd
103-
echo "extension=libev.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')"
106+
echo "extension=libev.so" | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/99-libev.ini" # load after ext-sockets
104107
if: ${{ matrix.php < 7.0 }}
105108
- run: composer install
106109
- run: vendor/bin/phpunit --coverage-text
@@ -115,6 +118,7 @@ jobs:
115118
strategy:
116119
matrix:
117120
php:
121+
- 8.6
118122
- 8.5
119123
- 8.4
120124
- 8.3
@@ -126,7 +130,7 @@ jobs:
126130
- 7.2
127131
- 7.1
128132
steps:
129-
- uses: actions/checkout@v4
133+
- uses: actions/checkout@v7
130134
- uses: shivammathur/setup-php@v2
131135
with:
132136
php-version: ${{ matrix.php }}
@@ -141,10 +145,10 @@ jobs:
141145

142146
PHPUnit-hhvm:
143147
name: PHPUnit (HHVM)
144-
runs-on: ubuntu-22.04
148+
runs-on: ubuntu-26.04
145149
continue-on-error: true
146150
steps:
147-
- uses: actions/checkout@v4
151+
- uses: actions/checkout@v7
148152
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
149153
- name: Run hhvm composer.phar install
150154
uses: docker://hhvm/hhvm:3.30-lts-latest

‎tests/StreamSelectLoopTest.php‎

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

43-
public function testStreamSelectReportsWarningForStreamWithFilter()
43+
public function testStreamSelectReportsWarningForMemoryStream()
4444
{
4545
if (defined('HHVM_VERSION')) {
4646
$this->markTestSkipped('Not supported on legacy HHVM');
4747
}
4848

49-
$stream = tmpfile();
50-
stream_filter_append($stream, 'string.rot13');
49+
$stream = fopen('php://memory', 'r+');
5150

5251
$this->loop->addReadStream($stream, $this->expectCallableNever());
5352

@@ -78,14 +77,13 @@ public function testStreamSelectReportsWarningForStreamWithFilter()
7877
$this->assertEquals($previous, $now);
7978
}
8079

81-
public function testStreamSelectThrowsWhenCustomErrorHandlerThrowsForStreamWithFilter()
80+
public function testStreamSelectThrowsWhenCustomErrorHandlerThrowsForMemoryStream()
8281
{
8382
if (defined('HHVM_VERSION')) {
8483
$this->markTestSkipped('Not supported on legacy HHVM');
8584
}
8685

87-
$stream = tmpfile();
88-
stream_filter_append($stream, 'string.rot13');
86+
$stream = fopen('php://memory', 'r+');
8987

9088
$this->loop->addReadStream($stream, $this->expectCallableNever());
9189

0 commit comments

Comments
 (0)