name: Check Codestyle

on:
  push:
    branches:
      - master

jobs:
  fix-style:
    name: Fix Code Style
    timeout-minutes: 15
    runs-on: ubuntu-latest
    env:
      COMPOSER_NO_INTERACTION: 1

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 7.4
        coverage: none
        tools: composer

    - name: Install dependencies
      run: |
        composer update --prefer-dist --no-suggest --no-progress

    - name: Check Code Style
      run: vendor/bin/phpcs
