From 9b85684bf6d9252981d5205cc764ce464066a1eb Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 17 Feb 2022 20:01:10 +0100 Subject: [PATCH 1/2] Support Laravel v9 + Github Actions --- .github/workflows/tests.yml | 43 ++++++++++++++++++++++++ composer.json | 20 +++++------ tests/Coroutine/ConnectorFactoryTest.php | 2 +- tests/Task/QueueFactoryTest.php | 2 +- tests/TestCase.php | 2 +- tests/Websocket/TableRoomTest.php | 2 +- 6 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..2270fc81 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,43 @@ +name: tests + +on: + push: + pull_request: + +jobs: + linux_tests: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')" + + strategy: + fail-fast: true + matrix: + include: + - php: "7.3" + framework: "laravel/framework:^8.0" + - php: "7.4" + framework: "laravel/framework:^8.0" + - php: "8.0" + framework: "laravel/framework:^8.0" + - php: "8.0" + framework: "laravel/framework:^9.0" + + name: PHP ${{ matrix.php }} (${{ matrix.framework }}) + + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: swoole + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + composer require ${{ matrix.framework }} --no-update -n + COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o + + - name: Execute tests + run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 042dde26..97a0a33e 100644 --- a/composer.json +++ b/composer.json @@ -22,20 +22,20 @@ ], "require": { "php": "^7.2|^8.0", - "illuminate/console": "~5.4|~6.0|~7.0|~8.0", - "illuminate/contracts": "~5.4|~6.0|~7.0|~8.0", - "illuminate/http": "~5.4|~6.0|~7.0|~8.0", - "illuminate/support": "~5.4|~6.0|~7.0|~8.0", + "illuminate/console": "~5.4|~6.0|~7.0|~8.0|~9.0", + "illuminate/contracts": "~5.4|~6.0|~7.0|~8.0|~9.0", + "illuminate/http": "~5.4|~6.0|~7.0|~8.0|~9.0", + "illuminate/support": "~5.4|~6.0|~7.0|~8.0|~9.0", "predis/predis": "^1.1" }, "require-dev": { - "laravel/lumen-framework": "~5.4|~6.0|~7.0|~8.0", - "phpunit/phpunit": "^7.5", - "phpunit/php-code-coverage": "^6.1", + "laravel/lumen-framework": "~5.4|~6.0|~7.0|~8.0|~9.0", + "phpunit/phpunit": "^9", + "phpunit/php-code-coverage": "^9", "php-coveralls/php-coveralls": "^2.1", - "mockery/mockery": "~1.0", - "codedungeon/phpunit-result-printer": "^0.14.0", - "php-mock/php-mock": "^2.0", + "mockery/mockery": "~1.5", + "codedungeon/phpunit-result-printer": "^0.31.0", + "php-mock/php-mock": "^2.3", "swoole/ide-helper": "@dev" }, "autoload": { diff --git a/tests/Coroutine/ConnectorFactoryTest.php b/tests/Coroutine/ConnectorFactoryTest.php index 27e70a4a..06ce255d 100644 --- a/tests/Coroutine/ConnectorFactoryTest.php +++ b/tests/Coroutine/ConnectorFactoryTest.php @@ -14,7 +14,7 @@ */ class ConnectorFactoryTest extends TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); $this->mockEnv('Laravel\Lumen'); diff --git a/tests/Task/QueueFactoryTest.php b/tests/Task/QueueFactoryTest.php index 66cae40b..6526f563 100644 --- a/tests/Task/QueueFactoryTest.php +++ b/tests/Task/QueueFactoryTest.php @@ -15,7 +15,7 @@ */ class QueueFactoryTest extends TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); $this->mockEnv('Laravel\Lumen'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 28f32301..a2ebba50 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -11,7 +11,7 @@ class TestCase extends BaseTestCase { - public function tearDown() + public function tearDown(): void { $this->addToAssertionCount( m::getContainer()->mockery_getExpectationCount() diff --git a/tests/Websocket/TableRoomTest.php b/tests/Websocket/TableRoomTest.php index 26a6813b..e7b84008 100644 --- a/tests/Websocket/TableRoomTest.php +++ b/tests/Websocket/TableRoomTest.php @@ -11,7 +11,7 @@ class TableRoomTest extends TestCase { protected $tableRoom; - public function setUp() + public function setUp(): void { $config = [ 'room_rows' => 4096, From 2be1bc18d7c15c385357e67af5b35e8dd98ffc54 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 17 Feb 2022 20:10:04 +0100 Subject: [PATCH 2/2] Bump PHP version for Scrutinizer --- .scrutinizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 90494730..4c4071ed 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,6 +1,6 @@ build: environment: - php: 7.2 + php: 7.3 filter: excluded_paths: