name: Pretty Code

on: [push, pull_request]

jobs:
  general:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup Node.js environment
        uses: actions/setup-node@v2.1.2
        with:
          node-version: '12'

      - name: Install Node.js dependencies
        run: npm install

      - name: Linting general code
        run: npm run cs:lint

  php:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0']

    steps:
      - uses: actions/checkout@v2

      - name: Setup PHP ${{ matrix.php }} environment
        uses: nanasess/setup-php@v3.0.5
        with:
          php-version: ${{ matrix.php }}

      - name: Validate composer.json and composer.lock
        run: composer validate

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

      - name: Linting PHP syntax
        run: composer cs:php

      - name: Linting PHP Coding Standard
        run: composer cs:lint

name: Pretty Code

on: [push, pull_request]

jobs:
  general:
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v2

      - name: Setup Node.js environment
        uses: actions/setup-node@v2.1.2
        with:
          node-version: '12'

      - name: Install Node.js dependencies
        run: npm install

      - name: Linting general code
        run: npm run cs:lint

  php:
    runs-on: ubuntu-20.04

    strategy:
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0']

    steps:
      - uses: actions/checkout@v2

      - name: Setup PHP ${{ matrix.php }} environment
        uses: nanasess/setup-php@v3.0.5
        with:
          php-version: ${{ matrix.php }}

      - name: Validate composer.json and composer.lock
        run: composer validate

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

      - name: Linting PHP syntax
        run: composer cs:php

      - name: Linting PHP Coding Standard
        run: composer cs:lint

Use ubuntu-20.04 instead of ubuntu-latest
workflow: Use ubuntu-20.04 instead of ubuntu-latest
