name: CI
on: [push]
concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true
jobs:
  build:
    runs-on: ubuntu-latest
    name: PHP ${{ matrix.php }} tests
    strategy:
      matrix:
        php: [7.2, 7.3, 7.4, 8.0, 8.1]
    steps:
      - uses: actions/checkout@v3
      - name: Setup PHP
        # Using tag 2.10.0
        uses: shivammathur/setup-php@e9a7adef28d778846228a0d481e041db73bd6db2
        with:
          php-version: ${{ matrix.php }}
          coverage: xdebug2
      - run: ./scripts/build
      - run: ./scripts/test
  buildall:
    if: ${{ always() }}
    runs-on: ubuntu-latest
    name: Build (matrix)
    needs: build
    steps:
      - name: Check build matrix status
        if: ${{ needs.build.result != 'success' }}
        run: exit 1
