on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

name: Test

jobs:
  build:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: [ ubuntu-latest ]
        php: [ '7.4', '8.0', '8.1', '8.2' ]
        include:
          - operating-system: windows-2019
            php: '7.4'
        #operating-system: [ ubuntu-18.04, windows-2019 ]
        #php: [ '7.2', '7.4', '8.0' ]
    name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }}
    steps:
      - uses: actions/checkout@v4
      - name: Setup PHP
        uses: nanasess/setup-php@v4
        with:
          php-version: ${{ matrix.php }}
      - name: Validate composer.json and composer.lock
        run: composer validate
      - run: bash ./scripts/test.sh
        ## Specify bash interpreter to ensure it runs on all platforms.
