@@ -2,20 +2,53 @@ name: Laravel
22
33on :
44 push :
5- branches : [ master ]
5+ branches : [ master, main ]
66 pull_request :
7- branches : [ master ]
7+ branches : [ master, main ]
88
99jobs :
1010 laravel-tests :
11-
1211 runs-on : ubuntu-latest
1312
13+ strategy :
14+ matrix :
15+ php-version : ['8.2', '8.3']
16+ laravel-version : ['8.*', '9.*', '10.*', '11.*']
17+ include :
18+ - laravel-version : ' 8.*'
19+ testbench-version : ' ^6.0'
20+ - laravel-version : ' 9.*'
21+ testbench-version : ' ^7.0'
22+ - laravel-version : ' 10.*'
23+ testbench-version : ' ^8.0'
24+ - laravel-version : ' 11.*'
25+ testbench-version : ' ^9.0'
26+
27+ name : PHP ${{ matrix.php-version }} - Laravel ${{ matrix.laravel-version }}
28+
1429 steps :
15- - uses : actions/checkout@v2
16- - name : Copy .env
17- run : php -r "file_exists('.env') || copy('.env.example', '.env');"
18- - name : Install Dependencies
19- run : composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
30+ - uses : actions/checkout@v4
31+
32+ - name : Setup PHP
33+ uses : shivammathur/setup-php@v2
34+ with :
35+ php-version : ${{ matrix.php-version }}
36+ extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
37+ coverage : none
38+
39+ - name : Cache Composer packages
40+ id : composer-cache
41+ uses : actions/cache@v3
42+ with :
43+ path : vendor
44+ key : ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
45+ restore-keys : |
46+ ${{ runner.os }}-php-${{ matrix.php-version }}-
47+
48+ - name : Install dependencies
49+ run : |
50+ composer require "laravel/framework:${{ matrix.laravel-version }}" "orchestra/testbench:${{ matrix.testbench-version }}" --no-interaction --no-update
51+ composer update --prefer-dist --no-interaction --no-suggest
52+
2053 - name : Execute tests (Unit and Feature tests) via PHPUnit
2154 run : vendor/bin/phpunit
0 commit comments