Skip to content

Commit 1347aba

Browse files
committed
Limit support to Laravel 11-13 / PHP 8.2-8.5 and add GitHub Actions CI
- Drop legacy Laravel (<=10) and PHP (<8.2) constraints in composer.json - Update orchestra/testbench (and -browser-kit, -dusk) to ^9|^10|^11 - Bump phpunit to ^10.5|^11|^12 and refresh phpunit.xml to PHPUnit 10+ schema - Replace abandoned Travis config with a matrix-based GitHub Actions workflow modeled on laravel-model-caching (PHP 8.2-8.5 x Laravel 11-13)
1 parent cc510d4 commit 1347aba

4 files changed

Lines changed: 81 additions & 31 deletions

File tree

.github/workflows/laravel.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Laravel Package
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
laravel-tests:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php: ['8.2', '8.3', '8.4', '8.5']
18+
laravel: ['11.*', '12.*', '13.*']
19+
exclude:
20+
- php: '8.5'
21+
laravel: '11.*'
22+
- php: '8.2'
23+
laravel: '13.*'
24+
include:
25+
- laravel: '11.*'
26+
testbench: '9.*'
27+
- laravel: '12.*'
28+
testbench: '10.*'
29+
- laravel: '13.*'
30+
testbench: '11.*'
31+
32+
name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }}
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Cache dependencies
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/.composer/cache
42+
key: dependencies-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ hashFiles('composer.json') }}
43+
restore-keys: |
44+
dependencies-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-
45+
46+
- name: Setup PHP ${{ matrix.php }}
47+
uses: shivammathur/setup-php@v2
48+
with:
49+
php-version: ${{ matrix.php }}
50+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
51+
coverage: ${{ matrix.php == '8.5' && matrix.laravel == '13.*' && 'xdebug' || 'none' }}
52+
53+
- name: Install specific Laravel version
54+
run: |
55+
composer require "illuminate/support:${{ matrix.laravel }}" "illuminate/cache:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-update --no-interaction
56+
57+
- name: Install Dependencies
58+
run: composer update --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
59+
60+
- name: Execute tests via PHPUnit
61+
run: vendor/bin/phpunit --configuration phpunit.xml ${{ matrix.php == '8.5' && matrix.laravel == '13.*' && '--coverage-clover coverage.xml' || '' }}
62+
63+
- name: Upload coverage to Codecov
64+
if: matrix.php == '8.5' && matrix.laravel == '13.*'
65+
uses: codecov/codecov-action@v5
66+
with:
67+
files: coverage.xml
68+
fail_ci_if_error: false
69+
env:
70+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,27 @@
2323
}
2424
],
2525
"require": {
26+
"php": "^8.2|^8.3|^8.4|^8.5",
2627
"geocoder-php/chain-provider": "^4.0|^5.0",
2728
"geocoder-php/geo-plugin-provider": "^4.0|^5.0",
2829
"geocoder-php/google-maps-provider": "^4.0|^5.0",
2930
"guzzlehttp/psr7": "*",
3031
"http-interop/http-factory-guzzle": "^1.0",
31-
"illuminate/cache": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
32-
"illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
32+
"illuminate/cache": "^11.0|^12.0|^13.0",
33+
"illuminate/support": "^11.0|^12.0|^13.0",
3334
"php-http/curl-client": "*",
34-
"php": "^8.0",
3535
"willdurand/geocoder": "^4.0|^5.0"
3636
},
3737
"require-dev": {
3838
"doctrine/dbal": "*",
3939
"geocoder-php/bing-maps-provider": "^4.0",
4040
"geocoder-php/geoip2-provider": "^4.0",
4141
"geocoder-php/maxmind-binary-provider": "^4.0",
42-
"laravel/legacy-factories": "^1.0",
43-
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0|^11.0",
44-
"orchestra/testbench-browser-kit": "^7.0|^8.5|^10.0",
45-
"orchestra/testbench-dusk": "^7.0|^8.22|^10.0",
42+
"orchestra/testbench": "^9.0|^10.0|^11.0",
43+
"orchestra/testbench-browser-kit": "^9.0|^10.0|^11.0",
44+
"orchestra/testbench-dusk": "^9.0|^10.0|^11.0",
4645
"php-coveralls/php-coveralls": "*",
47-
"phpunit/phpunit": "8.5|^9.0|^10.5|^11.5.3|^12.5.12"
46+
"phpunit/phpunit": "^10.5|^11.5.3|^12.5.12"
4847
},
4948
"autoload": {
5049
"psr-4": {

phpunit.xml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
backupGlobals="false"
5-
backupStaticAttributes="false"
65
bootstrap="vendor/autoload.php"
76
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
117
processIsolation="false"
128
stopOnFailure="false"
13-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
10+
cacheDirectory=".phpunit.cache"
1411
>
15-
<coverage processUncoveredFiles="true">
12+
<source>
1613
<include>
1714
<directory suffix=".php">./src</directory>
1815
</include>
19-
</coverage>
16+
</source>
2017
<testsuites>
2118
<testsuite name="Feature">
2219
<directory suffix="Test.php">./tests/Feature</directory>

0 commit comments

Comments
 (0)