-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel 11.x Compatibility #49
Merged
timacdonald
merged 16 commits into
timacdonald:main
from
laravel-shift:l11-compatibility
Mar 13, 2024
Merged
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ccb64ed
Bump dependencies for Laravel 11
laravel-shift a329cd1
Update GitHub Actions for Laravel 11
laravel-shift ff41964
Allow PHP 8.3
timacdonald 830fa4f
Bump collections
timacdonald 5ec9c76
formatting
timacdonald 6599543
formatting
timacdonald 7ef8e06
formatting
timacdonald 710f1a5
Fix tests
timacdonald 838477d
Update upgrade guide
timacdonald 59abe4b
Linting
timacdonald ee5d6c1
Fix build
timacdonald 31445e2
Fix version constraint
timacdonald a42a109
Fix compatibility issue
timacdonald dc25aed
Fix migrations
timacdonald a42d718
Fix conflict
timacdonald 4e0c55a
lint
timacdonald File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,128 +1,135 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
name: 'Lint' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
coverage: pcov | ||
|
||
- name: Install dependencies | ||
run: composer update | ||
|
||
- name: Check platform requirements | ||
run: composer check-platform-reqs | ||
|
||
- name: PHP-CS-Fixer | ||
run: composer fix -- --dry-run | ||
|
||
# - name: composer normalize | ||
# run: composer normalize --dry-run --no-interaction --verbose | ||
|
||
# - name: test coverage | ||
# run: | | ||
# ./vendor/bin/phpunit --coverage-clover=coverage.xml --debug --verbose | ||
# bash <(curl -s https://codecov.io/bash) | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# - name: Infection | ||
# run: ./vendor/bin/infection --show-mutations --min-covered-msi=100 --no-progress --no-interaction --verbose | ||
# env: | ||
# INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }} | ||
|
||
# - name: Psalm | ||
# run: ./vendor/bin/psalm --shepherd --no-progress | ||
|
||
# - name: PHPStan | ||
# run: ./vendor/bin/phpstan --no-interaction --verbose | ||
# | ||
# composer-require-checker | ||
# composer-unused | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
name: 'PHP: ${{ matrix.php }}; Laravel: ${{ matrix.laravel }}; Prefer: ${{ matrix.prefer }}' | ||
strategy: | ||
matrix: | ||
php: ['8.1', '8.2'] | ||
laravel: ['^9.0', '^10.0'] | ||
prefer: ['prefer-lowest', 'prefer-stable'] | ||
include: | ||
- testbench: '^7.0' | ||
laravel: '^9.0' | ||
- testbench: '^8.0' | ||
laravel: '^10.0' | ||
|
||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-prefer-${{ matrix.prefer }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-laravel-{{ matrix.laravel }}-prefer-${{ matrix.prefer}}-composer- | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: Remove dev packages | ||
run: | | ||
composer remove --dev --no-update \ | ||
friendsofphp/php-cs-fixer \ | ||
infection/infection \ | ||
nunomaduro/larastan \ | ||
phpstan/phpstan-strict-rules | ||
|
||
- name: Require Laravel and Testbench version | ||
run: composer require --no-update laravel/framework:"${{ matrix.laravel }}" illuminate/collections:"${{ matrix.laravel }}" illuminate/database:"${{ matrix.laravel }}" illuminate/http:"${{ matrix.laravel }}" illuminate/support:"${{ matrix.laravel }}" orchestra/testbench:"${{ matrix.testbench }}" | ||
|
||
- name: Support prefer-lowest in PHP 8.1 | ||
if: ${{ matrix.php == 8.1 && matrix.prefer == 'prefer-lowest' }} | ||
run: composer require --no-update nesbot/carbon:"^2.62.1" | ||
|
||
- name: Support prefer-lowest in PHP 8.2 | ||
if: ${{ matrix.php == 8.2 && matrix.prefer == 'prefer-lowest' }} | ||
run: composer require --no-update nesbot/carbon:"^2.62.1" | ||
|
||
- name: Install dependencies | ||
run: composer update --${{ matrix.prefer }} | ||
|
||
- name: Check platform requirements | ||
run: composer check-platform-reqs --verbose | ||
|
||
- name: Run tests | ||
run: composer test | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
|
||
name: Lint | ||
|
||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
coverage: pcov | ||
|
||
|
||
- name: Install dependencies | ||
run: composer update | ||
|
||
|
||
- name: Check platform requirements | ||
run: composer check-platform-reqs | ||
|
||
|
||
- name: PHP-CS-Fixer | ||
run: composer fix -- --dry-run | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
|
||
name: PHP: ${{ matrix.php }}; Laravel: ${{ matrix.laravel }}; Prefer: ${{ matrix.prefer }} | ||
|
||
strategy: | ||
matrix: | ||
php: ['8.1', '8.2'] | ||
timacdonald marked this conversation as resolved.
Show resolved
Hide resolved
|
||
laravel: ['11.0', ^9.0, ^10.0] | ||
prefer: [prefer-lowest, prefer-stable] | ||
include: | ||
- testbench: ^7.0 | ||
laravel: ^9.0 | ||
- testbench: ^8.0 | ||
laravel: ^10.0 | ||
- testbench: ^9.0 | ||
laravel: '11.0' | ||
exclude: | ||
- laravel: '11.0' | ||
php: '8.1' | ||
|
||
|
||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-prefer-${{ matrix.prefer }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-laravel-{{ matrix.laravel }}-prefer-${{ matrix.prefer}}-composer- | ||
|
||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
|
||
- name: Remove dev packages | ||
run: | | ||
composer remove --dev --no-update \ | ||
friendsofphp/php-cs-fixer \ | ||
infection/infection \ | ||
nunomaduro/larastan \ | ||
phpstan/phpstan-strict-rules | ||
|
||
|
||
- name: Require Laravel and Testbench version | ||
run: composer require --no-update laravel/framework:"${{ matrix.laravel }}" illuminate/collections:"${{ matrix.laravel }}" illuminate/database:"${{ matrix.laravel }}" illuminate/http:"${{ matrix.laravel }}" illuminate/support:"${{ matrix.laravel }}" orchestra/testbench:"${{ matrix.testbench }}" | ||
|
||
|
||
- name: Support prefer-lowest in PHP 8.1 | ||
if: "${{ matrix.php == 8.1 && matrix.prefer == 'prefer-lowest' }}" | ||
run: composer require --no-update nesbot/carbon:"^2.62.1" | ||
|
||
|
||
- name: Support prefer-lowest in PHP 8.2 | ||
if: "${{ matrix.php == 8.2 && matrix.prefer == 'prefer-lowest' }}" | ||
run: composer require --no-update nesbot/carbon:"^2.62.1" | ||
|
||
|
||
- name: Install dependencies | ||
run: composer update --${{ matrix.prefer }} | ||
|
||
|
||
- name: Check platform requirements | ||
run: composer check-platform-reqs --verbose | ||
|
||
|
||
- name: Run tests | ||
run: composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use php 8.3 as latest version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is okay as it is just linting / fixing.