From 819ce7c63b28b22286eb5944b3974ddb2154e348 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 9 Sep 2024 16:27:45 +0100 Subject: [PATCH 1/6] add initial github actions config for php 7.2 <-> 8.3 --- .github/workflows/php.yml | 46 +++++++++++++++++++++++++++++++++++++++ composer.json | 7 ++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..d6af887 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,46 @@ +name: GitHub Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + concurrency: + group: run--${{ github.ref }} + strategy: + matrix: + php-versions: ['7.2', '7.4', '8.0', '8.1', '8.2', '8.3'] + + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v4 + + - name: setup PHP. + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: php version check + run: php -v + + - name: Validate composer.json + run: composer validate --strict + + - name: run composer (install dependencies) + run: composer install --prefer-dist --no-progress + + - name: run psalm (static analysis) + run: vendor/bin/psalm + + - name: run unit tests + run: composer test + + diff --git a/composer.json b/composer.json index d096b77..8e54006 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,10 @@ } ], "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "infection/extension-installer": true + } }, "require": { "php": "^7.2|^8.0" @@ -42,7 +45,7 @@ }, "scripts": { "test": [ - "phpunit --stderr --coverage-text" + "@php vendor/bin/phpunit --stderr --coverage-text" ], "coverage": "phpunit --coverage-html=coverage" }, From d80c61ab74870ff621f9087df8b23146d6252f1d Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 9 Sep 2024 16:42:20 +0100 Subject: [PATCH 2/6] do not bother testing on php7.2/7.4 - a dependency on symfony/string gets installed which breaks ( vendor/symfony/string/ByteString.php:420:46 - Syntax error, unexpected T_DOUBLE_ARROW on line 420 ), travis is not setup for php < 8 anyway --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d6af887..ad7d2f5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -15,7 +15,7 @@ jobs: group: run--${{ github.ref }} strategy: matrix: - php-versions: ['7.2', '7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.0', '8.1', '8.2', '8.3'] runs-on: ubuntu-latest From bedef803821c91592ddec97851597c979180f040 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 9 Sep 2024 17:04:31 +0100 Subject: [PATCH 3/6] github action: add back in php7.2<->7.4 --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ad7d2f5..d6af887 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -15,7 +15,7 @@ jobs: group: run--${{ github.ref }} strategy: matrix: - php-versions: ['8.0', '8.1', '8.2', '8.3'] + php-versions: ['7.2', '7.4', '8.0', '8.1', '8.2', '8.3'] runs-on: ubuntu-latest From ca732180c675bf34b71e239a23a9b7f72db995f1 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 9 Sep 2024 17:05:10 +0100 Subject: [PATCH 4/6] relax version requirements a little - allowing psalm to update, symfony/string spec + sanmai/pipeline fixes syntax error issues when running under php7.2 etc --- composer.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 8e54006..2e7051f 100644 --- a/composer.json +++ b/composer.json @@ -30,9 +30,12 @@ "php": "^7.2|^8.0" }, "require-dev": { - "infection/infection": "^0.15|^0.20", - "phpunit/phpunit": "^8.0", - "vimeo/psalm": "4.16.1" + "composer/xdebug-handler": "^1.4|2.0", + "infection/infection": "^0.15|^0.20|^0.27", + "phpunit/phpunit": "^8.0|^9.0", + "symfony/string": "^5.4.43", + "sanmai/pipeline": "5.2.1", + "vimeo/psalm": "4.16.1|5.*" }, "autoload": { "psr-4": { From f93f5c2cb18050de4c8eb96b16c19201bc24e1c4 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 9 Sep 2024 20:03:04 +0100 Subject: [PATCH 5/6] someome more intelligent than me can implement the @template stuff properly --- src/MessInterface.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MessInterface.php b/src/MessInterface.php index f032eef..b58ea57 100644 --- a/src/MessInterface.php +++ b/src/MessInterface.php @@ -5,6 +5,9 @@ use ArrayAccess; +/** + * @psalm-suppress MissingTemplateParam + */ interface MessInterface extends ArrayAccess { /** @@ -333,4 +336,4 @@ public function findArrayOfStringToMixed(): ?array; */ #[\ReturnTypeWillChange] public function offsetGet($offset); -} \ No newline at end of file +} From 5c7af600bee5a3905175e0a85221b50e01eac0ee Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 9 Sep 2024 20:07:26 +0100 Subject: [PATCH 6/6] remove concurrency --- .github/workflows/php.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d6af887..593ea9a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -11,8 +11,6 @@ permissions: jobs: build: - concurrency: - group: run--${{ github.ref }} strategy: matrix: php-versions: ['7.2', '7.4', '8.0', '8.1', '8.2', '8.3']