name: PHP

on:
  push:
    branches:
    - develop
    - master
  pull_request:
    branches:
    - develop
    - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Setup PHP with PECL extension
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.2'

    - name: Create environment file
      run: cp .env.ci .env

    - name: Create unit testing database
      run: |
        mkdir -p database
        touch database/database.sqlite

    - 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: Install dependencies
      run: composer install --prefer-dist --no-progress

    - name: Generate Laravel key
      run: php artisan key:generate

    - name: Run migrations
      run: php artisan migrate

    - name: Run test suite
      run: vendor/bin/phpunit

    - name: Run code sniffer
      run: vendor/bin/phpcs --warning-severity=6

name: PHP

on:
  push:
    branches:
    - develop
    - master
  pull_request:
    branches:
    - develop
    - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Setup PHP with PECL extension
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.4'

    - name: Create environment file
      run: cp .env.ci .env

    - name: Create unit testing database
      run: |
        mkdir -p database
        touch database/database.sqlite

    - 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: Install dependencies
      run: composer install --prefer-dist --no-progress

    - name: Generate Laravel key
      run: php artisan key:generate

    - name: Run migrations
      run: php artisan migrate

    - name: Run test suite
      run: vendor/bin/phpunit

    - name: Run code sniffer
      run: vendor/bin/phpcs --warning-severity=6

Update GitHub Action to use PHP 7.4
Update GitHub Action to use PHP 7.4 [API-141]
