diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 477c6dc..6289c30 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,8 +1,12 @@ name: tests on: - push: pull_request: + push: + branches: + - '[0-9]+.x' + - '[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.x' jobs: latest: @@ -48,8 +52,8 @@ jobs: - name: Execute tests run: composer test - coverage: - name: Code coverage and static analysis + static: + name: Static analysis runs-on: ubuntu-latest steps: @@ -59,16 +63,11 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.0 - coverage: xdebug + php-version: 8.2 + coverage: none - name: Install dependencies run: composer update --prefer-dist --no-interaction --no-progress - name: Execute tests - run: composer test-ci - - - name: Upload coverage - run: | - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml + run: composer test-static diff --git a/README.md b/README.md index 7ea10cc..a0a7b9e 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ $replay = new ReplayPlugin($namingStrategy, $recorder); ``` bash $ composer test +$ composer test-static ``` diff --git a/composer.json b/composer.json index ac3a487..049e978 100644 --- a/composer.json +++ b/composer.json @@ -34,15 +34,7 @@ }, "scripts": { "test": "vendor/bin/simple-phpunit", - "test-ci": [ - "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml", - "vendor/bin/phpstan analyse src -l 8" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } + "test-static": "vendor/bin/phpstan" }, "prefer-stable": true, "minimum-stability": "dev" diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index 03744f5..0000000 --- a/phpstan.neon +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - ignoreErrors: - # The logger is initialized to NullLogger in the constructor of the FilesystemRecorder, but phpstan does not see that - - message: '#Cannot call method debug\(\) on Psr\\Log\\LoggerInterface\|null#' - path: src/Recorder/FilesystemRecorder.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..2c78b64 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,8 @@ +parameters: + level: 8 + paths: + - src/ + ignoreErrors: + # The logger is initialized to NullLogger in the constructor of the FilesystemRecorder, but phpstan does not see that + - message: '#Cannot call method debug\(\) on Psr\\Log\\LoggerInterface\|null#' + path: src/Recorder/FilesystemRecorder.php