From 988ba389113e68a3f71af16baba3a8f25de54524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 18 Feb 2023 18:17:28 +0100 Subject: [PATCH] Test on PHP 8.2 and update test environment --- .github/workflows/ci.yml | 30 ++++++++++++++++++++---------- README.md | 18 +++++++++--------- composer.json | 23 +++++++++++++---------- phpunit.xml.dist | 12 ++++++++---- phpunit.xml.legacy | 2 +- 5 files changed, 51 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e9670..21bdbe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,10 +6,14 @@ on: jobs: PHPUnit: - runs-on: ubuntu-latest + name: PHPUnit (PHP ${{ matrix.php }}) + runs-on: ubuntu-22.04 strategy: matrix: php: + - 8.2 + - 8.1 + - 8.0 - 7.4 - 7.3 - 7.2 @@ -20,11 +24,11 @@ jobs: - 5.4 - 5.3 steps: - - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - uses: actions/checkout@v3 + - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} + coverage: xdebug - run: composer install - run: vendor/bin/phpunit --coverage-text if: ${{ matrix.php >= 7.3 }} @@ -33,10 +37,16 @@ jobs: PHPUnit-hhvm: name: PHPUnit (HHVM) - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + continue-on-error: true steps: - - uses: actions/checkout@v2 - - run: curl -O https://dl.hhvm.com/ubuntu/pool/main/h/hhvm/hhvm_3.30.9-1~bionic_amd64.deb - - run: sudo apt install -y --allow-downgrades ./hhvm_3.30.9-1~bionic_amd64.deb - - run: hhvm $(which composer) install - - run: hhvm vendor/bin/phpunit --coverage-text + - uses: actions/checkout@v3 + - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM + - name: Run hhvm composer.phar install + uses: docker://hhvm/hhvm:3.30-lts-latest + with: + args: hhvm composer.phar install + - name: Run hhvm vendor/bin/phpunit + uses: docker://hhvm/hhvm:3.30-lts-latest + with: + args: hhvm vendor/bin/phpunit diff --git a/README.md b/README.md index 54d2eef..c6b4793 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # clue/reactphp-flux -[![CI status](https://github.com/clue/reactphp-flux/workflows/CI/badge.svg)](https://github.com/clue/reactphp-flux/actions) +[![CI status](https://github.com/clue/reactphp-flux/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-flux/actions) [![installs on Packagist](https://img.shields.io/packagist/dt/clue/reactphp-flux?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/reactphp-flux) Flux, the lightweight stream processor to concurrently do many (but not too many) things at once, @@ -117,7 +117,7 @@ $transformer->on('error', 'printf'); ``` -See also the [examples](examples). +See also the [examples](examples/). By changing the `$concurrency` parameter, you can see how processing this list without concurrency takes near `4s`, while using a concurrency setting of `5` @@ -651,36 +651,36 @@ all operations in memory without using a streaming approach. ## Install -The recommended way to install this library is [through Composer](https://getcomposer.org). +The recommended way to install this library is [through Composer](https://getcomposer.org/). [New to Composer?](https://getcomposer.org/doc/00-intro.md) This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -$ composer require clue/reactphp-flux:^1.3 +composer require clue/reactphp-flux:^1.3 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 7+ and +extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM. -It's *highly recommended to use PHP 7+* for this project. +It's *highly recommended to use the latest supported PHP version* for this project. ## Tests To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org): +dependencies [through Composer](https://getcomposer.org/): ```bash -$ composer install +composer install ``` To run the test suite, go to the project root and run: ```bash -$ php vendor/bin/phpunit +vendor/bin/phpunit ``` ## License diff --git a/composer.json b/composer.json index 022e77e..1d8c1d7 100644 --- a/composer.json +++ b/composer.json @@ -7,24 +7,27 @@ "authors": [ { "name": "Christian Lück", - "email": "christian@lueck.tv" + "email": "christian@clue.engineering" } ], - "autoload": { - "psr-4": { - "Clue\\React\\Flux\\": "src" - } - }, - "autoload-dev": { - "psr-4": { "Clue\\Tests\\React\\Flux\\": "tests/" } - }, "require": { + "php": ">=5.3", "react/promise": "^2.5 || ^1.2.1", "react/stream": "^1.2" }, "require-dev": { "clue/ndjson-react": "^1.0", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", "react/http": "^1.4" + }, + "autoload": { + "psr-4": { + "Clue\\React\\Flux\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Clue\\Tests\\React\\Flux\\": "tests/" + } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index eb41dfb..22f1c5b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,12 @@ - - + + convertDeprecationsToExceptions="true"> ./tests/ @@ -16,4 +17,7 @@ ./src/ + + + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy index afe6dfe..df86914 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -1,6 +1,6 @@ - +