name: PHP CI
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  ci:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        php: [7.3, 7.4, 8.0, 8.1, 8.2]

    steps:
      - name: Checkout
        uses: actions/checkout@v3
    
      - name: Setup PHP
        uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc
        with:
          php-version: ${{ matrix.php }}
          coverage: xdebug
    
      - name: Composer install
        run: composer install
    
      - name: PHP Linting
        run: ./vendor/bin/phpcs --standard=.duo_linting.xml -n src/* tests

      - name: PHP tests
        run: ./vendor/bin/phpunit --process-isolation tests
