kylekatarnls/carbonite

View on GitHub
.github/workflows/phpcs.yml

Summary

Maintainability
Test Coverage
name: PHPCS

on:
  push:
    branches: [ '**' ]
  pull_request:
    branches: [ '**' ]

jobs:
  style:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        php: [8.3]
        setup: ['stable']

    steps:
      - uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: ast, json
          tools: composer:v2
          coverage: none

      - name: Cache Composer packages
        id: composer-cache
        uses: actions/cache@v2
        with:
          path: vendor
          key: ${{ runner.os }}-phpcs-php-${{ matrix.php }}-${{ matrix.setup }}-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-phpcs-php-${{ matrix.php }}-${{ matrix.setup }}-

      - name: Install dependencies
        if: steps.composer-cache.outputs.cache-hit != 'true'
        run: |
          composer remove --no-update phpunit/phpunit friendsofphp/php-cs-fixer phpstan/phpstan phan/phan vimeo/psalm phpmd/phpmd --dev --no-interaction;
          composer update --prefer-dist --no-progress ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }}

      - name: Check style
        run: composer phpcs