From f6ebc3d3ed9b334d62ec8a682e56d00da87eb11a Mon Sep 17 00:00:00 2001 From: Mohamed Ashraf Date: Wed, 28 Feb 2024 11:49:20 +0400 Subject: [PATCH] Update tests.yml --- .github/workflows/tests.yml | 70 +++++++++++++++---------------------- 1 file changed, 28 insertions(+), 42 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c3260de..5da4c1b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,65 +1,51 @@ -name: Tests +name: run-tests on: - push - pull_request jobs: - tests: - runs-on: ubuntu-latest - + test: + runs-on: ${{ matrix.os }} strategy: fail-fast: true matrix: - php: [8.2, 8.1, 8.0, 7.4] - laravel: ['8.*', '9.*', '10.*', '11.*'] - dependency-version: [prefer-lowest, prefer-stable] - include: - - laravel: 8.* - testbench: ^6.23 - - laravel: 9.* - testbench: 7.* - - laravel: 10.* - testbench: 8.* - - laravel: 11.* - testbench: ^9.0 - exclude: - - laravel: 9.* - php: 7.4 - - laravel: 10.* - php: 7.4 - - laravel: 10.* - php: 8.0 - - laravel: 11.* - php: 8.1 - - laravel: 11.* - php: 8.0 - - laravel: 11.* - php: 7.4 + os: [ ubuntu-latest ] + php: [ 8.0, 8.1, 8.2 ] + stability: [ prefer-stable ] - name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} + name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v3 - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.composer/cache/files - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip coverage: none - - name: Install dependencies - run: | - composer require "illuminate/contracts:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction + - name: Validate Composer + run: composer validate + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Restore Composer Cache + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer + + - name: Install Dependencies + uses: nick-invision/retry@v2.8.3 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-dist --no-interaction --no-progress - name: Execute tests - run: vendor/bin/phpunit --verbose + run: vendor/bin/phpunit \ No newline at end of file