Skip to content

Commit 3579d1d

Browse files
authored
Merge pull request #6 from descom-es/laravel_11_tests
Add Support to Laravel 11
2 parents fec1bf2 + 5542445 commit 3579d1d

File tree

4 files changed

+86
-77
lines changed

4 files changed

+86
-77
lines changed

.github/workflows/analyze.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: analyze
1+
name: Analyse
22

33
on:
44
push:
@@ -8,31 +8,31 @@ on:
88

99
jobs:
1010
phpstan:
11-
1211
runs-on: ubuntu-latest
1312

1413
steps:
15-
- uses: actions/checkout@v2
16-
17-
- name: Setup PHP
18-
uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: 8.1
21-
22-
- name: Cache Composer packages
23-
id: composer-cache
24-
uses: actions/cache@v3
25-
with:
26-
path: vendor
27-
key: ${{ runner.os }}-php-8.1-1
28-
restore-keys: |
29-
${{ runner.os }}-php-8.1-1
30-
31-
- name: Install dependencies
32-
if: steps.composer-cache.outputs.cache-hit != 'true'
33-
run: |
34-
composer install --no-interaction --no-progress
35-
composer dump
36-
37-
- name: Run analyse phpstan
38-
run: vendor/bin/phpstan analyse --error-format github
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: 8.3
21+
22+
- name: Cache Composer packages
23+
id: composer-cache
24+
uses: actions/cache@v4
25+
with:
26+
path: vendor
27+
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-php-8.3-
30+
31+
- name: Install dependencies
32+
if: steps.composer-cache.outputs.cache-hit != 'true'
33+
run: |
34+
composer install --no-interaction --no-progress
35+
composer dump
36+
37+
- name: Run analyse phpstan
38+
run: vendor/bin/phpstan analyse --error-format github

.github/workflows/style_fix.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
1-
name: style_fix
1+
name: Style fix
22

33
on:
44
push:
55
branches: [master]
6-
pull_request:
7-
branches: [master]
86

97
jobs:
10-
style:
11-
8+
style-fix:
129
runs-on: ubuntu-latest
1310

1411
steps:
15-
- uses: actions/checkout@v2
12+
- name: Checkout code
13+
uses: actions/checkout@v4
1614

1715
- name: Setup PHP
1816
uses: shivammathur/setup-php@v2
1917
with:
20-
php-version: '8.1'
21-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, exif
22-
coverage: xdebug
18+
php-version: 8.3
2319

2420
- name: Cache Composer packages
2521
id: composer-cache
26-
uses: actions/cache@v3
22+
uses: actions/cache@v4
2723
with:
2824
path: vendor
29-
key: ${{ runner.os }}-php-8.1-1
25+
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }}
3026
restore-keys: |
31-
${{ runner.os }}-php-8.1-1
27+
${{ runner.os }}-php-8.3-
3228
3329
- name: Install dependencies
3430
if: steps.composer-cache.outputs.cache-hit != 'true'
@@ -39,7 +35,7 @@ jobs:
3935
- name: Fix styles
4036
run: vendor/bin/php-cs-fixer fix
4137

42-
- uses: EndBug/add-and-commit@v9
43-
4438
- name: Run style
4539
run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit
40+
41+
- uses: EndBug/add-and-commit@v9

.github/workflows/tests.yml

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: tests
1+
name: Tests
22

33
on:
44
push:
@@ -8,46 +8,59 @@ on:
88

99
jobs:
1010
phpunit:
11-
1211
runs-on: ubuntu-latest
1312

1413
strategy:
14+
fail-fast: true
1515
matrix:
16-
php-versions: ['8.3', '8.2', '8.1']
17-
laravel: [9.*, 10.*]
16+
php: [8.1, 8.2, 8.3]
17+
laravel: [9.*, 10.*, 11.*]
1818
include:
1919
- laravel: 9.*
2020
testbench: 7.*
2121
- laravel: 10.*
2222
testbench: 8.*
23+
- laravel: 11.*
24+
testbench: 9.*
25+
exclude:
26+
- laravel: 9.*
27+
php: 8.3
28+
- laravel: 11.*
29+
php: 8.1
2330

2431
steps:
25-
- uses: actions/checkout@v2
26-
27-
- name: Setup PHP
28-
uses: shivammathur/setup-php@v2
29-
with:
30-
php-version: ${{ matrix.php-versions }}
31-
extensions: curl, pdo, sqlite, pdo_sqlite
32-
33-
- name: Install SQLite 3
34-
run: sudo apt-get install sqlite3
35-
36-
- name: Cache Composer packages
37-
id: composer-cache
38-
uses: actions/cache@v3
39-
with:
40-
path: vendor
41-
key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
42-
restore-keys: |
43-
44-
${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}
45-
- name: Install dependencies
46-
if: steps.composer-cache.outputs.cache-hit != 'true'
47-
run: |
48-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
49-
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
50-
51-
52-
- name: Run test phpunit
53-
run: vendor/bin/phpunit
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Setup PHP
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: ${{ matrix.php }}
39+
extensions: curl, pdo, sqlite, pdo_sqlite
40+
41+
- name: Install SQLite 3
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install sqlite3
45+
46+
- name: Validate composer.json
47+
run: composer validate
48+
49+
- name: Cache Composer packages
50+
id: composer-cache
51+
uses: actions/cache@v4
52+
with:
53+
path: vendor
54+
key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
57+
58+
59+
- name: Install dependencies
60+
if: steps.composer-cache.outputs.cache-hit != 'true'
61+
run: |
62+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
63+
composer update --prefer-stable --prefer-dist --no-interaction
64+
65+
- name: Run test phpunit
66+
run: vendor/bin/phpunit --stop-on-error --stop-on-failure

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"require": {
1313
"php": "^8.1",
1414
"giggsey/libphonenumber-for-php": "^8.13",
15-
"laravel/framework": "^9.0|^10.0"
15+
"laravel/framework": "^9.0|^10.0|^11.0"
1616
},
1717
"require-dev": {
1818
"friendsofphp/php-cs-fixer": "^3.4",
1919
"nunomaduro/larastan": "^2.0",
20-
"orchestra/testbench": "^7.5|^8.0",
20+
"orchestra/testbench": "^7.5|^8.0|^9.0",
2121
"phpstan/phpstan": "^1.2",
22-
"phpunit/phpunit": "^9.3"
22+
"phpunit/phpunit": "^9.3|^10.0|^10.5"
2323
},
2424
"autoload": {
2525
"psr-4": {
@@ -47,4 +47,4 @@
4747
},
4848
"minimum-stability": "dev",
4949
"prefer-stable": true
50-
}
50+
}

0 commit comments

Comments
 (0)