80 lines
1.9 KiB
YAML
80 lines
1.9 KiB
YAML
name: Code Quality
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
phpcs:
|
|
name: PHP CodeSniffer
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
clean: 'true'
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '7.4'
|
|
extensions: mbstring, intl, zip
|
|
tools: composer:v2, phpcs
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Run PHPCS
|
|
run: composer run phpcs
|
|
continue-on-error: true
|
|
|
|
- name: Run PHPCBF (report only)
|
|
run: |
|
|
echo "Running PHPCBF in dry-run mode to show what would be fixed"
|
|
composer run phpcbf -- --dry-run
|
|
continue-on-error: true
|
|
|
|
phpstan:
|
|
name: PHPStan Static Analysis
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '7.4'
|
|
extensions: mbstring, intl, zip
|
|
tools: composer:v2, phpstan
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Run PHPStan
|
|
run: phpstan analyse --level=5 .
|
|
continue-on-error: true
|
|
|
|
phpmd:
|
|
name: PHP Mess Detector
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '7.4'
|
|
extensions: mbstring, intl, zip
|
|
tools: composer:v2, phpmd
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Run PHPMD
|
|
run: phpmd . text cleancode,codesize,controversial,design,naming,unusedcode --exclude vendor,node_modules,tests,bin,build,dist
|
|
continue-on-error: true
|