name: PHP CI

on: ["push", "pull_request"]

jobs:
  run:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      fail-fast: false
      matrix:
        operating-system: [ubuntu-24.04]
        php-versions: ['8.1', '8.2', '8.3', '8.4']
    name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.php-versions }}
        extensions: gd, xdebug, fileinfo
        coverage: xdebug
        tools: php-cs-fixer, phpunit

    - name: Composer Install
      run:  composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist

    - name: Running Tests
      run: |
        mkdir -p build/logs
        ./vendor/bin/phpunit
