- Add friendsofphp/php-cs-fixer to require-dev - Create .php-cs-fixer.dist.php configured for @PSR12 ruleset - Add php-cs-fixer dry-run step to CI pipeline - Auto-fix existing PSR-12 violations - Document code style tooling in readme.md
37 lines
735 B
YAML
37 lines
735 B
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'develop'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- 'develop'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.5'
|
|
extensions: apcu, mbstring
|
|
coverage: xdebug
|
|
ini-values: apc.enable_cli=1
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Run php-cs-fixer
|
|
run: vendor/bin/php-cs-fixer fix --dry-run --diff
|
|
|
|
- name: Run tests
|
|
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text
|