name: Static Analysis

on:
  - "push"
  - "pull_request"

jobs:
  analysis:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

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

    - name: "Setup PHP Action"
      uses: "shivammathur/setup-php@v2"
      with:
        php-version: "7.4"
        extensions: "intl, xdebug"

    - name: "Install dependencies"
      if: steps.composer-cache.outputs.cache-hit != 'true'
      run: composer install --prefer-dist --no-progress --no-suggest

    - name: "PHPStan"
      run: vendor/bin/phpstan analyse

    - name: "Psalm"
      run: vendor/bin/psalm


Create GitHub action for static analysis
Create GitHub action for static analysis
