name : run-tests.yml
name: run-tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: [8.0, 7.4]
        laravel: [7, 8]
        dependency-version: [prefer-lowest, prefer-stable]

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

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

      - name: Determine composer cache directory
        id: determine-composer-cache-directory
        run: 'echo "::set-output name=directory::$(composer config cache-dir)"'

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ${{ steps.determine-composer-cache-directory.outputs.directory }}
          key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
          restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
          coverage: none
          tools: composer:v2

      - name: Setup problem matchers for PHP
        run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

      - name: Setup problem matchers for PHPUnit
        run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

      - name: Select Laravel version
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 5
          max_attempts: 5
          command: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update --ignore-platform-reqs

      - name: Install Dependencies
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 5
          max_attempts: 5
          command: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress --prefer-dist -o -n --ignore-platform-reqs

      - name: Execute tests
        run: vendor/bin/phpunit

© 2025 UnknownSec
afwwrfwafr45458465
Password