From c086b1696282b8e56b5e57efb20c416a836c14e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 28 Jan 2021 20:26:00 +0200 Subject: [PATCH 1/3] Add php-parallel-lint/php-parallel-lint dev dependency --- composer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2f1a3a629..98a62aba4 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,9 @@ "ext-zlib": "*" }, "require-dev": { - "zf1s/phpunit": "3.7.39", - "phpunit/dbunit": "1.3.2" + "php-parallel-lint/php-parallel-lint": "1.0.0", + "phpunit/dbunit": "1.3.2", + "zf1s/phpunit": "3.7.39" }, "autoload": { "psr-0": { From bfada7de28bf9e93f5071d89b61804ff2f94b064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 28 Jan 2021 20:28:18 +0200 Subject: [PATCH 2/3] Add composer script "lint" to invoke parallel-lint --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 98a62aba4..f21c405b8 100644 --- a/composer.json +++ b/composer.json @@ -204,6 +204,7 @@ "zf1s/zend-xmlrpc": "self.version" }, "scripts": { + "lint": "parallel-lint --exclude vendor --exclude tests/Zend/Loader/_files/ParseError.php .", "test": "phpunit" } } From cf75c2983624824c5bf29b633cfcad7ec46355c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 28 Jan 2021 20:29:02 +0200 Subject: [PATCH 3/3] Use parallel-lint for GitHub actions Needed to move lint command after dependencies installed with composer --- .github/workflows/tests.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9205a244a..a9f1c368e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,14 +39,6 @@ jobs: ini-values: display_errors=off, log_errors=on extensions: :xdebug, ctype, dom, gd, iconv, ldap, mbstring, reflection, session, simplexml, spl, xml, zlib, memcache, pdo_sqlite, bcmath - - name: Lint PHP source files - run: | - # Lint All PHP source files - # Remove source expected to have syntax error - git rm tests/Zend/Loader/_files/ParseError.php - git ls-files '**/*.php' | while read f; do php -l "$f" > /dev/null || touch failed && echo -n .; done - test ! -f failed - # https://github.com/zf1s/zf1/pull/6#issuecomment-495397170 - name: Validate composer.json for all packages run: | @@ -56,6 +48,10 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest + - name: Lint PHP source files + run: | + composer lint + - name: Setup environment for PHPUnit run: | cp tests/TestConfiguration.ci.php tests/TestConfiguration.php