From c2f0679a92a1f3d982fa6c179236085d83f0a80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 19 Feb 2023 12:46:58 +0100 Subject: [PATCH] Test on PHP 8.2 and update test environment --- .github/workflows/ci.yml | 22 ++++++++++++++-------- README.md | 15 +++++++-------- composer.json | 18 +++++++++++------- phpunit.xml.dist | 12 ++++++++---- phpunit.xml.legacy | 2 +- 5 files changed, 41 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf214c8..21bdbe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,12 @@ on: jobs: PHPUnit: name: PHPUnit (PHP ${{ matrix.php }}) - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: php: + - 8.2 + - 8.1 - 8.0 - 7.4 - 7.3 @@ -22,7 +24,7 @@ jobs: - 5.4 - 5.3 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -35,12 +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 - - uses: azjezz/setup-hhvm@v1 + - 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: - version: lts-3.30 - - run: hhvm $(which composer) install - - run: hhvm vendor/bin/phpunit + 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 ecb0a82..a5bdc51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # clue/reactphp-term -[![CI status](https://github.com/clue/reactphp-term/workflows/CI/badge.svg)](https://github.com/clue/reactphp-term/actions) +[![CI status](https://github.com/clue/reactphp-term/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-term/actions) [![installs on Packagist](https://img.shields.io/packagist/dt/clue/term-react?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/term-react) Streaming terminal emulator, built on top of [ReactPHP](https://reactphp.org/). @@ -115,15 +115,14 @@ $stream->on('c0', function ($code) { ## 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/term-react:^1.3 - +composer require clue/term-react:^1.3 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. @@ -131,21 +130,21 @@ 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 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 cbb2671..d68a122 100644 --- a/composer.json +++ b/composer.json @@ -10,18 +10,22 @@ "email": "christian@clue.engineering" } ], - "autoload": { - "psr-4": { "Clue\\React\\Term\\": "src/" } - }, - "autoload-dev": { - "psr-4": { "Clue\\Tests\\React\\Term\\": "tests/" } - }, "require": { "php": ">=5.3", "react/stream": "^1.2" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", "react/event-loop": "^1.2" + }, + "autoload": { + "psr-4": { + "Clue\\React\\Term\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Clue\\Tests\\React\\Term\\": "tests/" + } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b7a4c21..5db045b 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 f6583ad..010d31c 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -1,6 +1,6 @@ - +