From 7cca3f3b192010415ff3f3a450daa9e29d89ee71 Mon Sep 17 00:00:00 2001 From: Jakub Theimer <5587309+theimerj@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:33:57 +0200 Subject: [PATCH] update test workflow --- .github/workflows/run-tests.yaml | 52 +++++++++++++++++--------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 0b2720b..10466e5 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -1,44 +1,48 @@ name: Tests on: - push: - branches: - - master pull_request: - branches: - - master - jobs: - test: - runs-on: ${{ matrix.os }} + build: + runs-on: ubuntu-latest strategy: - fail-fast: false matrix: - os: [ubuntu-latest] php: [8.2] - stability: [prefer-lowest, prefer-stable] - - name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} - + laravel: [11] steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout Code + uses: actions/checkout@v3 - - name: Setup PHP + - name: Setup PHP, with composer and extensions 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 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif + tools: composer:v2 coverage: none + ini-values: error_reporting=E_ALL + + - name: Set Laravel Version + run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update - - name: Setup problem matchers - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer- - name: Install dependencies - run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-dist --no-interaction --no-progress - name: Execute tests - run: vendor/bin/phpunit + run: composer test