name: Run Tests

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test:
    runs-on: ubuntu-latest

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

    - name: Set up PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.2'
        extensions: mbstring, intl, pdo_mysql, zip

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

    - name: List files in the root directory
      run: ls -la

    - name: Run PHPUnit tests
      run: vendor/bin/phpunit --configuration phpunit.xml.dist
