1
1
name : Test
2
+
2
3
on :
3
- push :
4
- branches :
5
- - main
4
+ push :
5
+ branches : [ main ]
6
+ pull_request :
7
+ branches : [ main ]
8
+
6
9
jobs :
7
- tests :
8
- name : Tests
9
- runs-on : ubuntu-latest
10
-
11
- steps :
12
- - name : Checkout code
13
- uses : actions/checkout@v2
14
- - name : Setup PHP
15
- uses : shivammathur/setup-php@v2
16
- with :
17
- php-version : 7.4
18
- tools : pecl
19
- extensions : pdo, sqlite, pdo_sqlite,json
20
- coverage : none
21
- - name : Validate composer.json and composer.lock
22
- run : composer validate
23
- - name : Cache Composer packages
24
- id : composer-cache
25
- uses : actions/cache@v2
26
- with :
27
- path : vendor
28
- key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29
- restore-keys : |
30
- ${{ runner.os }}-php-
31
- - name : Install dependencies
32
- if : steps.composer-cache.outputs.cache-hit != 'true'
33
- run : composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
34
- - name : Execute tests (Unit and Feature tests) via PHPUnit
35
- run : vendor/bin/phpunit
10
+ tests :
11
+ name : P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
12
+ runs-on : ${{ matrix.os }}
13
+ strategy :
14
+ fail-fast : false
15
+ matrix :
16
+ os : [ ubuntu-latest ]
17
+ php : [8.0, 7.4 ]
18
+ laravel : [ 8.*]
19
+ dependency-version : [ prefer-stable ]
20
+ include :
21
+ - laravel : 8.*
22
+ testbench : 6.*
23
+
24
+ steps :
25
+ - name : Checkout code
26
+ uses : actions/checkout@v2
27
+
28
+ - name : Validate composer.json and composer.lock
29
+ run : composer validate --strict
30
+
31
+ - name : Cache Composer packages
32
+ uses : actions/cache@v2
33
+ with :
34
+ path : vendor
35
+ key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
36
+ restore-keys : |
37
+ ${{ runner.os }}-php-
38
+
39
+ - name : Setup PHP
40
+ uses : shivammathur/setup-php@v2
41
+ with :
42
+ php-version : ${{ matrix.php }}
43
+ extensions : curl, mbstring, zip, pcntl, sqlite, pdo_sqlite, iconv
44
+ coverage : none
45
+
46
+ - name : Install dependencies - L${{ matrix.laravel }}
47
+ run : |
48
+ composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
49
+ composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
50
+
51
+ - name : Execute tests
52
+ run : vendor/bin/phpunit
0 commit comments