name: Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: true
      matrix:
        os: [ubuntu-latest]
        php: ["7.4", "8.0", "8.1"]
        dependency-version: [prefer-lowest, prefer-stable]

    name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

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

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: dom, libxml
          coverage: none
          tools: composer

      - name: Install dependencies
        run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

      - name: Execute tests
        run: composer test

Add workflow to run tests against different PHP versions
Add workflow to run tests against different PHP versions

Signed-off-by: Kai Sassnowski <bc490da4872504b550dc2de41aa8f01af7f15c6e@users.noreply.github.com>
