name: "Run tests"

on:
  push:
  workflow_call:

jobs:
  test:
    name: Pest (PHP ${{ matrix.php }} – ${{ matrix.os }})
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        php: [8.2]

    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, mysql
          coverage: none

      - name: Install dependencies
        run: |
          composer install

      - name: Execute tests
        run: vendor/bin/pest
