From 0f79150b4a40724bfb5db5b71ca1d7b62f8d53e8 Mon Sep 17 00:00:00 2001 From: Sergio Peris Date: Mon, 11 Mar 2024 22:52:07 +0100 Subject: [PATCH] Added Laravel 11.x support (#10) --- .github/workflows/run-tests.yml | 62 ++++++++++++++++++++++++++++----- composer.json | 12 +++---- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3c96c27..e2667b9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -5,22 +5,23 @@ on: branches: [main] pull_request: branches: [main] - schedule: - - cron: '0 0 * * *' jobs: - test: - runs-on: ${{ matrix.os }} + ubuntu: + runs-on: ubuntu-latest + strategy: - fail-fast: true + fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] - php: [8.1] - laravel: ['9.50', 10] + php: [8.1, 8.2] + laravel: [10, '11'] coverage-driver: [pcov] stability: [prefer-lowest, prefer-stable] + exclude: + - laravel: '11' + php: 8.1 - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: Ubuntu - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} steps: - name: Checkout code @@ -48,3 +49,46 @@ jobs: - name: Send code coverage report to Codecov.io uses: codecov/codecov-action@v4 + + windows: + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + php: [8.1, 8.2] + laravel: [10, '11'] + coverage-driver: [pcov] + stability: [prefer-lowest, prefer-stable] + exclude: + - laravel: '11' + php: 8.1 + + name: Windows - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - 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, fileinfo + coverage: ${{ matrix.coverage-driver }} + + - name: Setup problem matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install dependencies + run: | + composer require "illuminate/contracts=${{ matrix.laravel }}.*" --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction + + - name: Execute tests + run: vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Send code coverage report to Codecov.io + uses: codecov/codecov-action@v4 diff --git a/composer.json b/composer.json index ff0ef5a..932066c 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ } ], "require": { - "php": "^8.1", - "illuminate/contracts": "^9.5|^10.0", - "illuminate/database": "^9.5|^10.0", - "illuminate/support": "^9.5|^10.0" + "php": "^8.1|^8.2", + "illuminate/contracts": "^10.0|^11.0", + "illuminate/database": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0" }, "require-dev": { - "orchestra/testbench": "^7.5|^8.0", - "phpunit/phpunit": "^9.5" + "orchestra/testbench": "^8.0|^9.0", + "phpunit/phpunit": "^9.5|^10.0" }, "autoload": { "psr-4": {