Skip to content

Commit cd5ca29

Browse files
Laravel 11.x Compatibility (#47)
* Bump dependencies for Laravel 11 * Update GitHub Actions for Laravel 11 * build: Update actions/checkout from v2 to v4 * build: Remove obsolete verbose flag for PHPUnit * build: Use PCOV for code coverage * test: Provide dedicated PHPUnit 10 support * build: Added PHP 8.3 to test matrix * build: Updated test matrix excludes according to [Laravel support policies](https://laravel.com/docs/11.x/releases) --------- Co-authored-by: Shift <[email protected]>
1 parent f7e4f94 commit cd5ca29

File tree

4 files changed

+75
-21
lines changed

4 files changed

+75
-21
lines changed

.github/workflows/tests.yaml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,70 @@ on:
77
jobs:
88
tests:
99
runs-on: ubuntu-latest
10+
1011
strategy:
1112
fail-fast: false
1213
matrix:
13-
php: [7.4, 8.0, 8.1, 8.2]
14-
laravel: [6.*, 7.*, 8.*, 9.*, 10.*]
14+
php: [7.4, 8.0, 8.1, 8.2, 8.3]
15+
laravel: ['6.*', '7.*', '8.*', '9.*', '10.*', '11.*']
1516
exclude:
16-
# excludes unsupported combinations
17+
- php: 7.4
18+
laravel: 11.*
1719
- php: 8.0
18-
laravel: 10.*
20+
laravel: 11.*
21+
- php: 8.1
22+
laravel: 11.*
1923
- php: 7.4
2024
laravel: 10.*
25+
- php: 8.0
26+
laravel: 10.*
2127
- php: 7.4
2228
laravel: 9.*
23-
- php: 8.1
24-
laravel: 6.*
29+
- php: 8.3
30+
laravel: 9.*
31+
- php: 8.2
32+
laravel: 8.*
33+
- php: 8.3
34+
laravel: 8.*
2535
- php: 8.1
2636
laravel: 7.*
2737
- php: 8.2
38+
laravel: 7.*
39+
- php: 8.3
40+
laravel: 7.*
41+
- php: 8.1
2842
laravel: 6.*
2943
- php: 8.2
30-
laravel: 7.*
44+
laravel: 6.*
45+
- php: 8.3
46+
laravel: 6.*
3147

3248
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
3349

3450
steps:
3551
- name: Checkout code
36-
uses: actions/checkout@v2
52+
uses: actions/checkout@v4
3753

3854
- name: Setup PHP
3955
uses: shivammathur/setup-php@v2
4056
with:
4157
php-version: ${{ matrix.php }}
4258
extensions: dom, curl, libxml, mbstring, zip, json
43-
coverage: none
59+
coverage: pcov
4460

4561
- name: Install dependencies
4662
run: |
4763
composer require "illuminate/contracts=${{ matrix.laravel }}" --no-update
4864
composer update --prefer-dist --no-interaction --no-progress
49-
- name: Execute tests
50-
run: vendor/bin/phpunit --verbose --configuration=phpunit.xml.dist
65+
66+
- name: Grab PHPUnit version
67+
id: phpunit_version
68+
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
69+
70+
- name: Execute tests (PHPUnit 10)
71+
if: ${{ startsWith(steps.phpunit_version.outputs.VERSION, '10.') }}
72+
run: vendor/bin/phpunit --configuration=phpunit10.xml.dist
73+
74+
- name: Execute tests (PHPUnit < 10)
75+
if: ${{ !startsWith(steps.phpunit_version.outputs.VERSION, '10.') }}
76+
run: vendor/bin/phpunit --configuration=phpunit.xml.dist

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ composer.lock
33
.idea
44
build
55
.phpunit.result.cache
6+
.phpunit.cache

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
"require": {
1818
"php": ">=7.4|^8.0",
1919
"guzzlehttp/guzzle": "^7.0",
20-
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
21-
"illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0",
22-
"illuminate/bus": "^6.0|^7.0|^8.0|^9.0|^10.0",
23-
"illuminate/mail": "^6.0|^7.0|^8.0|^9.0|^10.0",
24-
"illuminate/queue": "^6.0|^7.0|^8.0|^9.0|^10.0",
25-
"illuminate/notifications": "^6.0|^7.0|^8.0|^9.0|^10.0",
20+
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
21+
"illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
22+
"illuminate/bus": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
23+
"illuminate/mail": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
24+
"illuminate/queue": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
25+
"illuminate/notifications": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
2626
"ext-json": "*",
27-
"enlightn/security-checker": "^1.3"
27+
"enlightn/security-checker": "^1.3|^2.0"
2828
},
2929
"require-dev": {
30-
"laravel/slack-notification-channel": "^1.0|^2.0",
31-
"phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0",
30+
"laravel/slack-notification-channel": "^1.0|^2.0|^3.2",
31+
"phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0|^10.5",
3232
"squizlabs/php_codesniffer": "~2.3|^3.6",
33-
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0",
33+
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0",
3434
"mockery/mockery": "^1.2"
3535
},
3636
"suggest": {

phpunit10.xml.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
cacheDirectory=".phpunit.cache">
7+
<testsuites>
8+
<testsuite name=":vendor Test Suite">
9+
<directory>tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
<coverage>
13+
<report>
14+
<html outputDirectory="build/coverage"/>
15+
<text outputFile="build/coverage.txt"/>
16+
<clover outputFile="build/logs/clover.xml"/>
17+
</report>
18+
</coverage>
19+
<logging>
20+
<junit outputFile="build/report.junit.xml"/>
21+
</logging>
22+
<source>
23+
<include>
24+
<directory>./src</directory>
25+
</include>
26+
</source>
27+
</phpunit>

0 commit comments

Comments
 (0)