This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coding Standards & Static Analysis | |
on: [push, pull_request] | |
jobs: | |
qa: | |
name: Quality Assurance | |
runs-on: ubuntu-latest | |
env: | |
php-version: '8.3' | |
php-extensions: yaml | |
PHP_CS_FIXER_IGNORE_ENV: 1 # PHP8.3 remove when PHP-CS-Fixer fully supports PHP 8.3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.php-version }} | |
extensions: ${{ env.php-extensions }} | |
ini-values: zend.assertions=1 | |
coverage: none # Xdebug is installed by default, so we remove it manually | |
- name: Creating var directory | |
run: mkdir -p var/cache | |
- name: Cache QA results | |
uses: actions/[email protected] | |
with: | |
path: var/cache | |
key: qa-${{ hashFiles('composer.lock') }}-${{ hashFiles('.github/workflows/quality-assurance.yml') }} | |
restore-keys: qa-${{ hashFiles('composer.lock') }}-${{ hashFiles('.github/workflows/quality-assurance.yml') }} | |
- name: Checking Composer | |
run: composer validate --strict | |
- uses: "ramsey/composer-install@v2" | |
- name: Checking for forgotten TODO | |
run: composer check-todo | |
- name: Running Psalm (without plugin installed) | |
run: php vendor/bin/psalm --config=tests/StaticAnalysis/psalm-without-plugin.xml | |
- name: Running Psalm (with plugin installed) | |
run: php vendor/bin/psalm --config=tests/StaticAnalysis/psalm-with-plugin.xml | |
- name: Running PHPStan (without extension installed) | |
run: php vendor/bin/phpstan --configuration=tests/StaticAnalysis/phpstan-without-extension.neon.dist | |
- name: Running PHPStan (with extension installed) | |
run: php vendor/bin/phpstan --configuration=tests/StaticAnalysis/phpstan-with-extension.neon.dist | |
- name: Running PHPStan (global) | |
run: php vendor/bin/phpstan | |
- name: Running PHP Coding Standards Fixer | |
run: php vendor/bin/php-cs-fixer fix --dry-run | |
- name: Running Rector | |
run: php vendor/bin/rector --dry-run |