---
name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

    steps:
      - uses: actions/checkout@v4
      - name: Set up PHP ${{ matrix.php-version }}
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: sqlite
          ini-values: include_path=.:/usr/share/php
      - name: Lint
        if: ${{ matrix.php-version != '7.4' }}
        run: for f in ./**/*.php; do php -l "$f"; done;
      - name: Tests
        run: pear run-tests -d tests/
