diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.yml index 617d21b..59ace54 100644 --- a/.github/workflows/test-php.yml +++ b/.github/workflows/test-php.yml @@ -23,6 +23,7 @@ jobs: strategy: matrix: php-versions: ['8.2', '8.3', '8.4', '8.5'] + phpcs-versions: ['3', '4'] steps: - name: Checkout code @@ -46,6 +47,13 @@ jobs: if [ "${{ matrix.php-versions }}" == "8.2" ]; then composer require --dev phpunit/phpunit:^11 --no-update fi + if [ "${{ matrix.phpcs-versions }}" == "3" ]; then + composer require squizlabs/php_codesniffer:^3.10 --no-update --with-all-dependencies + composer require --dev drupal/coder:^8.3 --no-update --with-all-dependencies + elif [ "${{ matrix.phpcs-versions }}" == "4" ]; then + composer require squizlabs/php_codesniffer:^4 --no-update --with-all-dependencies + composer require --dev drupal/coder:^9@alpha --no-update --with-all-dependencies + fi composer install ${{ matrix.php-versions == '8.5' && '--ignore-platform-reqs' || '' }} - name: Validate composer.json @@ -70,7 +78,7 @@ jobs: uses: actions/upload-artifact@v5 if: ${{ matrix.php-versions != '8.2' }} with: - name: ${{github.job}}-code-coverage-report-${{ matrix.php-versions }} + name: ${{github.job}}-code-coverage-report-php${{ matrix.php-versions }}-phpcs${{ matrix.phpcs-versions }} path: .logs include-hidden-files: true if-no-files-found: error diff --git a/composer.json b/composer.json index 8fd378d..1c09a2b 100644 --- a/composer.json +++ b/composer.json @@ -19,11 +19,11 @@ "require": { "php": ">=8.2", "dealerdirect/phpcodesniffer-composer-installer": "^1", - "squizlabs/php_codesniffer": "^3.10" + "squizlabs/php_codesniffer": "^3.10 || ^4" }, "require-dev": { "alexskrypnyk/phpunit-helpers": "^0.13.0", - "drupal/coder": "^8.3", + "drupal/coder": "^8.3 || ^9@alpha", "ergebnis/composer-normalize": "^2.42", "phpstan/phpstan": "^2", "phpunit/phpunit": "^12", diff --git a/tests/Functional/FunctionalTestCase.php b/tests/Functional/FunctionalTestCase.php index e7ad36a..dab5f6c 100644 --- a/tests/Functional/FunctionalTestCase.php +++ b/tests/Functional/FunctionalTestCase.php @@ -68,7 +68,7 @@ protected function runPhpcs(string $file_path, array $expected_violations = []): // Run phpcs using ProcessTrait. $this->processRun( $phpcs_bin, - ['--standard=DrevOps', '--report=json', $file_path], + ['--standard=DrevOps', '--report=json', '-q', $file_path], timeout: 120 );