Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Laravel 12.x Compatibility #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 17 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: tests

on: [push]
on:
- push

jobs:
build:
runs-on: ubuntu-latest

timeout-minutes: 10

strategy:
matrix:
php: ['8.0', '8.1', '8.2', '8.3']
laravel: ['8.75', '8.83', '9.0', '9.52', '10.0', '10.48', '11.0']
laravel: ['8.75', '8.83', '9.0', '9.52', '10.0', '10.48', '11.0', '12.0']
enum: ['2', '3', '4']
exclude:
- php: '8.0'
Expand All @@ -20,20 +23,29 @@ jobs:
laravel: '11.0'
- php: '8.1'
laravel: '11.0'
- laravel: '12.0'
php: '8.0'
- laravel: '12.0'
php: '8.1'

name: PHP ${{ matrix.php }} Laravel ${{ matrix.laravel }} Enum ${{ matrix.enum }}

steps:
- name: Checkout
uses: actions/checkout@master

- name: Installing PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: mbstring, json, sqlite3
tools: composer:v2

- name: Lock Laravel Version
run: |
composer require "konekt/enum:${{ matrix.enum }}.*" --no-update -v
composer require "laravel/framework:${{ matrix.laravel }}.*" --no-update -v

- name: Testbench Version Adjustments
run: |
is_smaller_version() [[ $(echo -e "$1\n$2"|sort -V|head -1) != $2 ]]
Expand All @@ -44,9 +56,12 @@ jobs:
is_smaller_version "${{ matrix.laravel }}" "9.7" && composer req "orchestra/testbench-core:7.3.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.6" && composer req "orchestra/testbench-core:7.2.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.5" && composer req "orchestra/testbench-core:7.1.0" --no-update || true

- name: Composer Install
run: composer install --prefer-dist --no-progress --no-interaction

- name: Create Database
run: mkdir -p database && touch database/database.sqlite

- name: Run Tests
run: php vendor/bin/phpunit --testdox
16 changes: 12 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
"description": "Enum attribute casting for Eloquent models",
"type": "library",
"license": "MIT",
"keywords": ["enum", "konekt", "artkonekt", "laravel", "eloquent"],
"keywords": [
"enum",
"konekt",
"artkonekt",
"laravel",
"eloquent"
],
"minimum-stability": "dev",
"prefer-stable": true,
"support": {
Expand All @@ -26,14 +32,16 @@
"require": {
"php": "^8.0",
"konekt/enum": "^2.0.2 || ^3.0 | ^4.0",
"illuminate/database": "^8.75|9.*|10.*|11.*"
"illuminate/database": "^8.75|9.*|10.*|11.* || ^12.0"
},
"require-dev": {
"phpunit/phpunit": "9 - 10",
"illuminate/events": "^8.75|9.*|10.*|11.*"
"illuminate/events": "^8.75|9.*|10.*|11.* || ^12.0"
},
"autoload": {
"psr-4": { "Konekt\\Enum\\Eloquent\\": "src/" }
"psr-4": {
"Konekt\\Enum\\Eloquent\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
Expand Down