name: Static Analysis

on: [ push, pull_request ]

jobs:
  composer-validation:
    name: Composer Validation
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Validate composer.json
        run: composer validate --strict

  coding-standards:
    name: Coding Standards
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Install dependencies
        run: composer install --no-progress

      - name: Check coding standards
        run: composer coding-standards

  phan:
    name: Phan
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php:
          - '8.0'
          - '8.1'
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}

      - name: Install dependencies
        run: composer install --no-progress

      - name: Run Phan
        run: composer static-analysis:phan -- --no-progress-bar

  phpstan:
    name: PHPStan
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php:
          - '8.0'
          - '8.1'
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}

      - name: Install dependencies
        run: composer install --no-progress

      - name: Run PHPStan
        run: composer static-analysis:phpstan -- --no-progress

  psalm:
    name: Psalm
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php:
          - '8.0'
          - '8.1'
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}

      - name: Install dependencies
        run: composer install --no-progress

      - name: Run Psalm
        run: composer static-analysis:psalm -- --no-progress

Add a new GitHub workflow for static analysis
Add a new GitHub workflow for static analysis
