name: Static analysis

on:
  push:
    branches:
      - 2.x
  pull_request:

jobs:
  phpstan:
    name: PHPStan
    runs-on: ubuntu-latest

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

      - name: PHPStan
        uses: docker://oskarstark/phpstan-ga
        env:
          REQUIRE_DEV: true
        with:
          args: analyze --no-progress

  php-cs-fixer:
    name: PHP-CS-Fixer
    runs-on: ubuntu-latest

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

      - name: PHP-CS-Fixer
        uses: docker://oskarstark/php-cs-fixer-ga
        with:
          args: --dry-run --diff
