From 2b989d55df27c462f2d27329b922acb92fffaa96 Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Thu, 12 Jan 2023 21:37:16 +0700 Subject: [PATCH] Support Laravel 10 --- .github/workflows/tests.yml | 127 ++++++++++++++++++++++++------------ composer.json | 7 +- 2 files changed, 89 insertions(+), 45 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d579a9..d7b2efe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,48 +1,91 @@ name: "Tests" on: - push: - branches: [develop] + push: + branches: + - "**" pull_request: - branches: [main] - schedule: - - cron: '0 0 * * *' + branches: [main] jobs: - run-tests: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [7.4, 8.0, 8.1] - laravel: [8.*] - dependency-version: [prefer-lowest, prefer-stable] - include: - - laravel: 8.* - testbench: ^6.23 - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - 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 - - - name: Setup Problem Matches - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest - - - name: Execute tests - run: vendor/bin/phpunit + run-tests: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + php: [7.2, 7.3, 7.4, '8.0', 8.1, 8.2] + laravel: [6.*, 7.*, 8.*, 9.*, 10.*] + os: [ubuntu-latest] + include: + - laravel: 10.* + testbench: 8.* + - laravel: 9.* + testbench: 7.* + - laravel: 8.* + testbench: 6.* + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + + exclude: + - laravel: 6.* + php: 7.1 + - laravel: 6.* + php: 8.1 + - laravel: 6.* + php: 8.2 + - laravel: 7.* + php: 7.1 + - laravel: 7.* + php: 8.1 + - laravel: 7.* + php: 8.2 + - laravel: 8.* + php: 7.1 + - laravel: 8.* + php: 7.2 + - laravel: 8.* + php: 8.2 + - laravel: 9.* + php: 7.1 + - laravel: 9.* + php: 7.2 + - laravel: 9.* + php: 7.3 + - laravel: 9.* + php: 7.4 + - laravel: 10.* + php: 7.1 + - laravel: 10.* + php: 7.2 + - laravel: 10.* + php: 7.3 + - laravel: 10.* + php: 7.4 + - laravel: 10.* + php: '8.0' + + name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extension: mbstring + coverage: none + + - name: Install dependencies + run: | + composer require "illuminate/contracts:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer install --prefer-dist --no-interaction --no-suggest + + - name: Installed dependencies + run: composer show -D + + - name: Execute tests + run: vendor/bin/phpunit --exclude-group skipped diff --git a/composer.json b/composer.json index 29a905d..f8e425b 100644 --- a/composer.json +++ b/composer.json @@ -17,12 +17,13 @@ ], "type": "library", "require": { - "php": "^7.4|^8.0", - "illuminate/support": "^6.20.13|7.30.4|^8.22.2" + "php": "^7.2|^8.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0" }, "require-dev": { "phpunit/phpunit": "^9.3", - "orchestra/testbench": "^5.20|^6.23", + "orchestra/testbench": "^4.0 || ^6.0 || ^7.0 || ^8.0", + "phpunit/phpunit": "^8.3 || ^9.0", "friendsofphp/php-cs-fixer": "^3.0" }, "autoload": {