Merge pull request #41 from valbeat/dependabot/composer/phpstan/phpst… #97
This file contains hidden or 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: Code Style | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| php-cs-fixer: | |
| name: PHP CS Fixer (PHP ${{ matrix.php-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-version: ['8.4'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| coverage: none | |
| - name: Cache Composer packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Cache PHP CS Fixer | |
| uses: actions/cache@v3 | |
| with: | |
| path: .php-cs-fixer.cache | |
| key: ${{ runner.os }}-php-cs-fixer-${{ hashFiles('**/.php-cs-fixer.dist.php') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-cs-fixer- | |
| - name: Run PHP CS Fixer | |
| run: composer cs-check | |
| - name: Show diff on failure | |
| if: failure() | |
| run: composer cs-fix -- --diff --dry-run |