# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml

on:
  push:
    branches:
      - v1.2.x
  pull_request:
    branches:
      - v1.2.x


name: "CI"

jobs:

  tests:
    name: "Unit Tests"
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - windows-latest
        php-version:
          - "7.2"
          - "7.3"
          - "7.4"
          - "8.0"
          - "8.1"
          - "8.2"
          - "8.3"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3

      - name: "Install PHP with extensions"
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          coverage: pcov
          extensions: json

      - name: "Install dependencies with composer"
        uses: ramsey/composer-install@v2

      - name: "Run tests with phpunit"
        run: php vendor/phpunit/phpunit/phpunit --configuration=phpunit.xml
