Skip to content

Commit 24709f8

Browse files
Merge pull request #3 from intouchinsight/ip-8351-adding-laravel-12-support
IP 8351: Adding Laravel 12 support
2 parents b048895 + 9e84b04 commit 24709f8

File tree

15 files changed

+184
-80
lines changed

15 files changed

+184
-80
lines changed

.github/workflows/tests.yml

Lines changed: 78 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,55 +6,114 @@ on:
66
- main
77
- '*.x'
88
pull_request:
9-
schedule:
10-
- cron: '0 0 * * *'
11-
12-
permissions:
13-
contents: read
149

10+
# Laravel 12 temporarily limited to <12.38.0 due to https://github.com/orchestral/canvas/issues/47
1511
jobs:
1612
tests:
1713
runs-on: ubuntu-latest
18-
1914
strategy:
2015
fail-fast: false
2116
matrix:
22-
php: [ '7.3', '7.4', '8.0', '8.1', '8.2' ]
23-
laravel: [^8]
17+
php: [8.3, 8.4]
18+
laravel: ["^11.44.7", "^12.0 <12.38.0"]
2419
dependency-version: [prefer-stable]
20+
include:
21+
- laravel: "^12.0 <12.38.0"
22+
testbench: "10.6.*"
23+
- laravel: "^11.44.7"
24+
testbench: "9.15.*"
2525

2626
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }}
2727

2828
steps:
2929
- name: Checkout code
30-
uses: actions/checkout@v3
31-
with:
32-
fetch-depth: 10
30+
uses: actions/checkout@v4
3331

3432
- name: Setup PHP
3533
uses: shivammathur/setup-php@v2
3634
with:
3735
php-version: ${{ matrix.php }}
36+
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
3837
coverage: xdebug
3938

39+
- name: Setup problem matchers
40+
run: |
41+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
42+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
43+
4044
- name: Install dependencies
4145
run: |
42-
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
43-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress
46+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
47+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
4448
4549
- name: Execute tests
50+
env:
51+
XDEBUG_MODE: coverage
4652
run: vendor/bin/phpunit
4753

4854
- name: PHPStan Static Analysis
4955
uses: php-actions/phpstan@v3
5056
with:
5157
path: src/
5258

53-
- name: Upload Scrutinizer coverage
54-
uses: sudo-bot/action-scrutinizer@latest
59+
phpcs:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
65+
- name: Setup PHP
66+
uses: shivammathur/setup-php@v2
5567
with:
56-
cli-args: "--format=php-clover tests/reports/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
68+
php-version: 8.4
69+
tools: cs2pr, phpcs
70+
71+
- name: Setup phpcs config
72+
run: |
73+
{
74+
echo '<?xml version="1.0"?>'
75+
echo '<ruleset name="DD Detection Standard">'
76+
echo '<description>Detects and fails for dd found in code.</description>'
77+
echo '<arg name="colors"/>'
78+
echo '<arg value="n"/>'
79+
echo '<rule ref="Generic.PHP.ForbiddenFunctions">'
80+
echo '<properties>'
81+
echo '<property name="forbiddenFunctions" type="array">'
82+
echo '<element key="dd" value="null"/>'
83+
echo '</property>'
84+
echo '</properties>'
85+
echo '</rule>'
86+
echo '</ruleset>'
87+
} > custom_phpcs_style.xml
88+
89+
- name: Run PHP CS Fixer
90+
run: |
91+
(phpcs --standard=custom_phpcs_style.xml --report=checkstyle src | cs2pr) || true
92+
phpcs --standard=custom_phpcs_style.xml src
5793
pint:
58-
uses: intouchinsight/github-workflows/.github/workflows/laravel-pint.yml@main
59-
with:
60-
php_version: '8.3'
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v4
98+
99+
- name: Find pint version
100+
id: find_pint_version
101+
run: |
102+
PINT_VERSION='v1.25.1'
103+
echo "Attempting to load pint version from composer.lock"
104+
if [ -f composer.lock ]; then
105+
PINT_VERSION=$(jq '.["packages-dev"][] | select(.name == "laravel/pint") | .version' composer.lock)
106+
fi
107+
echo "Found pint version: $PINT_VERSION"
108+
echo "PINT_VERSION=$PINT_VERSION" >> $GITHUB_OUTPUT
109+
110+
- name: Setup PHP
111+
uses: shivammathur/setup-php@v2
112+
with:
113+
php-version: 8.4
114+
tools: cs2pr, pint:${{ steps.find_pint_version.outputs.PINT_VERSION }}
115+
116+
- name: Run pint
117+
run: |
118+
(pint --test --format=checkstyle | cs2pr) || true
119+
pint --test -v --ansi

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ tests/coverage
33
vendor
44
composer.lock
55
.phpstorm.meta.php
6-
tests/reports
6+
tests/reports/*
7+
!tests/reports/.gitignore
78
.phpunit.result.cache

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![Latest Version on Packagist][ico-version]][link-packagist]
44
[![Software License][ico-license]](LICENSE.md)
55
[![Build Status][ico-github]][link-github]
6-
[![Code Coverage][ico-coverage]][link-coverage]
76

87
### Supported Versions
98
| Laravel Version | Package Tag | Supported |
@@ -93,8 +92,5 @@ which will fire your batch job at the correct time.
9392
[ico-version]: https://img.shields.io/packagist/v/lukewaite/laravel-queue-aws-batch.svg?style=flat-square
9493
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
9594
[ico-github]: https://img.shields.io/github/workflow/status/lukewaite/laravel-queue-aws-batch/Tests/main.svg?style=flat-square
96-
[ico-coverage]: https://img.shields.io/scrutinizer/coverage/g/lukewaite/laravel-queue-aws-batch/main.svg?style=flat-square
97-
9895
[link-packagist]: https://packagist.org/packages/lukewaite/laravel-queue-aws-batch
9996
[link-github]: https://github.com/lukewaite/laravel-queue-aws-batch/actions/workflows/tests.yml?query=branch%3Amain++
100-
[link-coverage]: https://scrutinizer-ci.com/g/lukewaite/laravel-queue-aws-batch/?branch=main

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
}
2020
},
2121
"require": {
22-
"illuminate/support": "^10.0|^11.0",
22+
"php": "^8.3|^8.4",
23+
"illuminate/support": "^11.44.7|^12.24.0",
2324
"aws/aws-sdk-php": "^3.20.6"
2425
},
2526
"require-dev": {
2627
"mockery/mockery": "^1.5",
27-
"laravel/framework": "^10.0|^11.0",
28-
"phpunit/phpunit": "^9.5",
28+
"laravel/framework": "^11.44.7|^12.24.0",
29+
"phpunit/phpunit": "^10.0|^11.0",
2930
"squizlabs/php_codesniffer": "^3.5",
30-
"scrutinizer/ocular": "^1.3",
31-
"phpstan/phpstan": "^1.9",
32-
"nunomaduro/larastan": "^1|^2",
33-
"orchestra/testbench": "^8.0|^9.0",
34-
"laravel/pint": "^1.16"
31+
"phpstan/phpstan": "^2.1",
32+
"larastan/larastan": "^3.0",
33+
"orchestra/testbench": "^9.15|^10.6",
34+
"laravel/pint": "^1.25.1"
3535
},
3636
"scripts": {
3737
"test": "phpunit",

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
includes:
2-
- ./vendor/nunomaduro/larastan/extension.neon
2+
- ./vendor/larastan/larastan/extension.neon
33

44
parameters:
55
paths:

phpunit.xml.dist

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage processUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd">
3+
<coverage>
74
<report>
85
<clover outputFile="tests/reports/clover.xml"/>
9-
<text outputFile=""/>
106
</report>
117
</coverage>
8+
<source>
9+
<include>
10+
<directory suffix=".php">src/</directory>
11+
</include>
12+
</source>
1213
<testsuites>
1314
<testsuite name=":vendor Test Suite">
1415
<directory>tests</directory>

src/Console/QueueWorkBatchCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ protected function gatherWorkerOptions()
118118
/**
119119
* Store a failed job event.
120120
*
121-
* @param \Illuminate\Queue\Events\JobFailed $event
122121
* @return void
123122
*/
124123
protected function logFailedJob(JobFailed $event)

src/Contracts/JobContainerOverrides.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Laravel Queue for AWS Batch.
45
*
@@ -32,7 +33,6 @@
3233
* ]
3334
*
3435
* Interface JobContainerOverrides
35-
* @package LukeWaite\LaravelQueueAwsBatch\Contracts
3636
*/
3737
interface JobContainerOverrides
3838
{

src/Exceptions/JobNotFoundException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212

1313
namespace LukeWaite\LaravelQueueAwsBatch\Exceptions;
1414

15-
class JobNotFoundException extends LaravelAwsBatchQueueException
16-
{
17-
}
15+
class JobNotFoundException extends LaravelAwsBatchQueueException {}

src/Exceptions/LaravelAwsBatchQueueException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212

1313
namespace LukeWaite\LaravelQueueAwsBatch\Exceptions;
1414

15-
class LaravelAwsBatchQueueException extends \Exception
16-
{
17-
}
15+
class LaravelAwsBatchQueueException extends \Exception {}

0 commit comments

Comments
 (0)