name: PHPStorm

on: [push]

jobs:

  ide:
    name: IDE Inspection
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    ############################################################################
    - name: Set up PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.3'
        tools: composer, prestissimo, pecl
        coverage: none

    - name: Install AST extension
      run: sudo pecl install -f ast

      #https://github.com/actions/cache/blob/master/examples.md#php---composer
    - name: Cache composer packages
      id: composer-cache
      run: |
        composer config cache-files-dir
        echo "::set-output name=dir::$(composer config cache-files-dir)"
    - uses: actions/cache@v1
      with:
        path: ${{ steps.composer-cache.outputs.dir }}
        key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          ${{ runner.os }}-composer-

    - name: Update project dependencies
      run: |
        composer install --prefer-dist --no-progress --no-suggest
        composer dump-autoload --optimize
    ############################################################################

    - name: Run PHPStorm
      uses: mridang/action-phpstorm@master
      with:
        target: .
        profile: ./.idea/inspectionProfiles/CI.xml
        output: ./output
        verbosity: v2
        scope: Inspection

    - name: Archive inspection results
      uses: actions/upload-artifact@v1
      with:
        name: inspection-results
        path: output

name: PHPStorm

on: [push]

jobs:

  ide:
    name: IDE Inspection
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    ############################################################################
    - name: Set up PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.3'
        tools: composer, prestissimo, pecl
        coverage: none

    - name: Install AST extension
      run: sudo pecl install -f ast

      #https://github.com/actions/cache/blob/master/examples.md#php---composer
    - name: Cache composer packages
      id: composer-cache
      run: |
        composer config cache-files-dir
        echo "::set-output name=dir::$(composer config cache-files-dir)"
    - uses: actions/cache@v1
      with:
        path: ${{ steps.composer-cache.outputs.dir }}
        key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          ${{ runner.os }}-composer-

    - name: Update project dependencies
      run: |
        composer install --prefer-dist --no-progress --no-suggest
        composer dump-autoload --optimize
        rm -rf vendor/bin
    ############################################################################

    - name: Run PHPStorm
      uses: mridang/action-phpstorm@master
      with:
        target: .
        profile: ./.idea/inspectionProfiles/CI.xml
        output: ./output
        verbosity: v2
        scope: Inspection

    - name: Archive inspection results
      uses: actions/upload-artifact@v1
      with:
        name: inspection-results
        path: output

Remove vendor/bin folder prior to IDE inspections
Remove vendor/bin folder prior to IDE inspections
