name: Run tests

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php: [8.1, 8.2, 8.3]
    
    name: PHP ${{ matrix.php }} - Statamic ${{ matrix.statamic }}
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
      
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
          coverage: none
      
      - name: Install dependencies
        run: |
          composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
      
      - name: Execute tests
        run: vendor/bin/pest
