Skip to content

Commit

Permalink
Merge pull request #22 from laravel-shift/l10-compatibility
Browse files Browse the repository at this point in the history
Laravel 10.x Compatibility
  • Loading branch information
Sébastien Nikolaou authored Feb 2, 2023
2 parents 458df1a + 7fb6f6d commit 30e0b9f
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 147 deletions.
177 changes: 90 additions & 87 deletions .github/workflows/tests-php7.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,107 @@
name: Tests

on:
push:
pull_request:
push:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [7.4, 7.3, 7.2, 7.1]
laravel: [^8.0, ^7.0, ^6.0, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
include:
- laravel: ^8.0
testbench: ^6.0
phpunit: 9.3
- laravel: ^7.0
testbench: ^5.0
phpunit: 8.5
- laravel: ^6.0
testbench: ^4.0
phpunit: 8.5
- laravel: 5.8.*
testbench: ^3.8
phpunit: 7.5
- laravel: 5.7.*
testbench: ^3.7
phpunit: 7.0
- laravel: 5.6.*
testbench: ^3.6
phpunit: 7.0
- laravel: 5.5.*
testbench: ^3.5
phpunit: 6.0
exclude:
- laravel: ^8.0
php: 7.2
- laravel: ^8.0
php: 7.1
- laravel: ^7.0
php: 7.1
- laravel: ^6.0
php: 7.1
- laravel: 5.7.*
php: 7.4
- laravel: 5.6.*
php: 7.4
- laravel: 5.6.*
php: 7.3
- laravel: 5.5.*
php: 7.4
strategy:
fail-fast: true
matrix:
php: [7.4, 7.3, 7.2, 7.1]
laravel: [^8.0, ^7.0, ^6.0, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
include:
- laravel: ^8.0
testbench: ^6.0
phpunit: 9.3
- laravel: ^7.0
testbench: ^5.0
phpunit: 8.5
- laravel: ^6.0
testbench: ^4.0
phpunit: 8.5
- laravel: 5.8.*
testbench: ^3.8
phpunit: 7.5
- laravel: 5.7.*
testbench: ^3.7
phpunit: 7.0
- laravel: 5.6.*
testbench: ^3.6
phpunit: 7.0
- laravel: 5.5.*
testbench: ^3.5
phpunit: 6.0
exclude:
- laravel: ^8.0
php: 7.2
- laravel: ^8.0
php: 7.1
- laravel: ^7.0
php: 7.1
- laravel: ^6.0
php: 7.1
- laravel: 5.7.*
php: 7.4
- laravel: 5.6.*
php: 7.4
- laravel: 5.6.*
php: 7.3
- laravel: 5.5.*
php: 7.4

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

steps:
- name: Checkout code
uses: actions/checkout@v2
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: pcov
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: pcov

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- 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: Setup problem matchers for PHPUnit
run: 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: Get composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:^${{ matrix.phpunit }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:^${{ matrix.phpunit }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Setup PCOV
if: ${{ matrix.phpunit < 8 }}
run: |
composer require pcov/clobber
vendor/bin/pcov clobber
- name: Setup PCOV
if: ${{ matrix.phpunit < 8 }}
run: |
composer require pcov/clobber
vendor/bin/pcov clobber
- name: Execute tests
run: vendor/bin/phpunit --verbose --whitelist=src --coverage-clover=build/coverage/clover.xml
- name: Execute tests
run: vendor/bin/phpunit --verbose --whitelist=src --coverage-clover=build/coverage/clover.xml

- name: Upload coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage/clover.xml"
- name: Upload coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage/clover.xml"
127 changes: 70 additions & 57 deletions .github/workflows/tests-php8.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,86 @@
name: Tests

on:
push:
pull_request:
push:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.1, 8.0]
laravel: [^9.0, ^8.0, '^7.0', ^6.0]
include:
- laravel: ^9.0
testbench: ^7.0
- laravel: ^8.0
testbench: ^6.0
- laravel: ^7.0
testbench: ^5.0
- laravel: ^6.0
testbench: ^4.0
exclude:
- laravel: ^7.0
php: 8.1
- laravel: ^6.0
php: 8.1
strategy:
fail-fast: true
matrix:
php: [8.2, 8.1, 8.0]
laravel: [^10.0, ^9.0, ^8.0, "^7.0", ^6.0]
include:
- laravel: ^10.0
testbench: ^8.0
- laravel: ^9.0
testbench: ^7.0
- laravel: ^8.0
testbench: ^6.0
- laravel: ^7.0
testbench: ^5.0
- laravel: ^6.0
testbench: ^4.0
exclude:
- laravel: ^10.0
php: 8.0
- laravel: ^8.0
php: 8.2
- laravel: ^7.0
php: 8.2
- laravel: ^7.0
php: 8.1
- laravel: ^6.0
php: 8.2
- laravel: ^6.0
php: 8.1

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

steps:
- name: Checkout code
uses: actions/checkout@v2
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: pcov
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: pcov

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- 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: Setup problem matchers for PHPUnit
run: 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: Get composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --verbose --whitelist=src --coverage-clover=build/coverage/clover.xml
- name: Execute tests
run: vendor/bin/phpunit --verbose --whitelist=src --coverage-clover=build/coverage/clover.xml

- name: Upload coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage/clover.xml"
- name: Upload coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage/clover.xml"
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"require": {
"php": "^7.1|^8.0",
"guzzlehttp/guzzle": "^6.0|^7.0",
"illuminate/console": "^5.5|^6.0|^7.0|^8.0|^9.0",
"illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0"
"illuminate/console": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0"
},
"require-dev": {
"mockery/mockery": "^0.9|^1.0",
"orchestra/testbench": "^3.5|^4.0|^5.0|^6.0",
"orchestra/testbench": "^3.5|^4.0|^5.0|^6.0|^8.0",
"phpunit/phpunit": "^7.0|^8.5|^9.3"
},
"autoload": {
Expand Down

0 comments on commit 30e0b9f

Please sign in to comment.