name: CI
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    name: Validate, lint and test
    steps:
      - uses: actions/checkout@v2

      - name: Validate composer files
        run: composer validate --strict

      - name: Lint all PHP files
        run: composer run lint

      - name: Cache Composer packages
        id: composer-cache
        uses: actions/cache@v1
        with:
          path: vendor
          key: ${{ runner.os }}-node-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-node-

      - name: Install dependencies
        if: steps.composer-cache.outputs.cache-hit != 'true'
        run: composer install --prefer-dist --no-suggest --no-ansi --no-progress -o

      - name: Start dev server
        run: composer run dev --timeout=0 &

      - name: Run tests
        run: composer run test

      - name: Run static code analysis
        run: composer run sa
name: CI
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php: ['7.2', '7.3', '7.4']
    name: Validate, lint and test on PHP ${{ matrix.php }}
    steps:
      - uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}

      - name: Debug PHP version
        run: |
            php -i
            php -m

      - name: Validate composer files
        run: composer validate --strict

      - name: Lint all PHP files
        run: composer run lint

      - name: Cache Composer packages
        id: composer-cache
        uses: actions/cache@v1
        with:
          path: vendor
          key: ${{ runner.os }}-node-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-node-

      - name: Install dependencies
        if: steps.composer-cache.outputs.cache-hit != 'true'
        run: composer install --prefer-dist --no-suggest --no-ansi --no-progress -o

      - name: Start dev server
        run: composer run dev --timeout=0 &

      - name: Run tests
        run: composer run test

      - name: Run static code analysis
        run: composer run sa
Test on multiple versions of PHP
Test on multiple versions of PHP
