Skip to content

Commit

Permalink
Refactor static-analysis workflow
Browse files Browse the repository at this point in the history
Replaces single workflow with individual jobs for PHPStan, Psalm, PHPMD, and ComposerRequireChecker. Each job runs separately on the latest Ubuntu with PHP 8.3, improving maintainability and granularity of static analysis tasks.
  • Loading branch information
koriym committed Nov 24, 2024
1 parent 06623d4 commit 45a67b3
Showing 1 changed file with 52 additions and 5 deletions.
57 changes: 52 additions & 5 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,55 @@ on:
workflow_dispatch:

jobs:
sa:
uses: ray-di/.github/.github/workflows/static-analysis.yml@v1
with:
php_version: 8.3
has_crc_config: true
static-analysis-phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: cs2pr
coverage: none
- run: |
composer install --no-interaction --no-progress --prefer-dist
ls -la vendor-bin/tools/ # デバッグ用
- run: ./vendor/bin/phpstan analyse -c phpstan.neon --no-progress --no-interaction --error-format=checkstyle | cs2pr

static-analysis-psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: cs2pr
coverage: none
- run: composer install --no-interaction --no-progress --prefer-dist
- run: ./vendor/bin/psalm --show-info=false --output-format=checkstyle --shepherd | cs2pr

static-analysis-phpmd:
name: PHPMD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- run: composer install --no-interaction --no-progress --prefer-dist
- run: ./vendor/bin/phpmd src text ./phpmd.xml

static-analysis-composer-require-checker:
name: ComposerRequireChecker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
- run: |
composer install --no-interaction --no-progress --prefer-dist
composer require maglnet/composer-require-checker --dev --with-all-dependencies
- run: ./vendor/bin/composer-require-checker check ./composer.json

0 comments on commit 45a67b3

Please sign in to comment.