Skip to content
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

Add Laravel 12 Compatibility #2

Merged
merged 3 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
12 changes: 7 additions & 5 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ name: PHPStan
on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'
- "**.php"
- "phpstan.neon.dist"
- ".github/workflows/phpstan.yml"

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: "8.4"
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v3

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
32 changes: 25 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,38 @@ name: run-tests

on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- "**.php"
- ".github/workflows/run-tests.yml"
- "phpunit.xml.dist"
- "composer.json"
- "composer.lock"

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.2, 8.1, 8.0]
laravel: [11.*, 10.*, 9.*]
php: [8.4, 8.3, 8.2, 8.1, 8.0]
laravel: [12.*, 11.*, 10.*, 9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
exclude:
- laravel: 12.*
php: 8.1
- laravel: 12.*
php: 8.0
- laravel: 11.*
php: 8.1
- laravel: 11.*
Expand All @@ -35,7 +45,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -49,10 +59,18 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Fix dependencies
if: ${{ startsWith(matrix.laravel, '9') }}
run: |
composer require "nesbot/carbon:^2.72.6" --no-interaction --no-update

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: List Installed Dependencies
run: composer show -D

- name: Execute tests
run: vendor/bin/pest
run: vendor/bin/pest --ci
8 changes: 6 additions & 2 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ on:
release:
types: [released]

permissions:
contents: write

jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: main

Expand All @@ -21,7 +25,7 @@ jobs:
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
"require": {
"php": "^8.0",
"doctrine/sql-formatter": "^1.1",
"illuminate/contracts": "^9.33 | ^10.0 | ^11.0",
"illuminate/view": "^9.33 | ^10.0 | ^11.0",
"illuminate/contracts": "^9.33 | ^10.0 | ^11.0 | ^12.0",
"illuminate/view": "^9.33 | ^10.0 | ^11.0 | ^12.0",
"spatie/laravel-package-tools": "^1.9.2"
},
"require-dev": {
"larastan/larastan": "^2.9",
"larastan/larastan": "^2.9 | ^3.0",
"nunomaduro/collision": "^6.0 | ^7.0 | ^8.0",
"orchestra/testbench": "^7.0 | ^8.0 | ^9.0",
"pestphp/pest": "^1.21 | ^2.0",
"pestphp/pest-plugin-laravel": "^1.1 | ^2.0",
"orchestra/testbench": "^7.0 | ^8.0 | ^9.0 | ^10.0",
"pestphp/pest": "^1.21 | ^2.0 | ^3.0",
"pestphp/pest-plugin-laravel": "^1.1 | ^2.0 | ^3.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5 | ^10.0 | ^11.0"
"phpstan/phpstan-deprecation-rules": "^1.0 | ^2.0",
"phpstan/phpstan-phpunit": "^1.0 | ^2.0",
"phpstan/phpstan-strict-rules": "^1.0 | ^2.0",
"phpunit/phpunit": "^9.5.24 | ^10.5 | ^11.5"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ parameters:
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: true