1414
1515 runs-on : ubuntu-latest
1616
17+ strategy :
18+ fail-fast : false
19+ matrix :
20+ php : [8.3, 8.4, 8.5]
21+ laravel : [10.*, 11.*, 12.*, 13.*]
22+ exclude :
23+ - php : 8.3
24+ laravel : 10.*
25+ - php : 8.4
26+ laravel : 10.*
27+ - php : 8.5
28+ laravel : 10.*
29+
1730 steps :
1831 - uses : actions/checkout@v4
1932
33+ - name : Setup PHP ${{ matrix.php }}
34+ uses : shivammathur/setup-php@v2
35+ with :
36+ php-version : ${{ matrix.php }}
37+ extensions : pcov
38+ coverage : pcov
39+
2040 - name : Validate composer.json and composer.lock
2141 run : composer validate --strict
2242
@@ -25,15 +45,34 @@ jobs:
2545 uses : actions/cache@v3
2646 with :
2747 path : vendor
28- key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
48+ key : ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
2949 restore-keys : |
50+ ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
51+ ${{ runner.os }}-php-${{ matrix.php }}-
3052 ${{ runner.os }}-php-
3153
3254 - name : Install dependencies
33- run : composer install --prefer-dist --no-progress
55+ run : |
56+ composer require "laravel/framework:${{ matrix.laravel }}" --no-update --no-interaction
57+ composer update --prefer-dist --no-progress --no-interaction
3458
3559 # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
3660 # Docs: https://getcomposer.org/doc/articles/scripts.md
3761
3862 # - name: Run test suite
3963 # run: composer run-script test
64+
65+ - name : Run test suite
66+ run : composer run-script test
67+
68+ - name : Upload coverage to Codecov
69+ uses : codecov/codecov-action@v4
70+ with :
71+ files : ./coverage/clover.xml
72+ fail_ci_if_error : true
73+
74+ - name : Run Laravel Pint
75+ run : composer run-script lint
76+
77+ - name : Run PHPStan analysis
78+ run : composer run-script analyse
0 commit comments