name: Run tests

on: push

jobs:
  php-tests:
    runs-on: ubuntu-latest

    name: Run Package Tests

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

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ~/.composer/cache/files
          key: dependencies-composer-${{ hashFiles('composer.json') }}

      - name: Setup PHP
        uses: shivammathur/setup-php@v1
        with:
          php-version: 7.3
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
          coverage: none

      - name: Install Composer dependencies
        run: composer install --prefer-dist --no-interaction --no-suggest

      - name: Execute tests
        run: vendor/bin/phpunit --verbose