1
1
name : run-tests
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' *'
7
+ tags :
8
+ - ' *'
9
+ pull_request :
10
+ branches :
11
+ - ' *'
4
12
5
13
jobs :
6
- test :
7
- runs-on : ${{ matrix.os }}
8
- strategy :
9
- fail-fast : false
10
- matrix :
11
- os : [ubuntu-latest, windows-latest]
12
- php : [8.0, 7.4, 7.3, 7.2]
13
- laravel : [6.*, 7.*, 8.*]
14
- dependency-version : [prefer-lowest, prefer-stable]
15
- include :
16
- - laravel : 8.*
17
- testbench : 6.*
18
- - laravel : 7.*
19
- testbench : 5.*
20
- - laravel : 6.*
21
- testbench : 4.*
22
- exclude :
23
- - php : 7.2
24
- laravel : 8.*
25
-
26
- name : P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
27
-
28
- steps :
29
- - name : Checkout code
30
- uses : actions/checkout@v1
31
-
32
- - name : Cache dependencies
33
- uses : actions/cache@v1
34
- with :
35
- path : ~/.composer/cache/files
36
- key : dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
37
-
38
- - name : Setup PHP
39
- uses : shivammathur/setup-php@v2
40
- with :
41
- php-version : ${{ matrix.php }}
42
- extensions : curl, dom, fileinfo, libxml, mbstring, pdo, sqlite, pdo_sqlite, zip
43
- coverage : pcov
44
-
45
- - name : Install dependencies
46
- run : |
47
- composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
48
- composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
49
-
50
- - name : Execute tests
51
- run : vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
52
-
53
- - uses : codecov/codecov-action@v1
54
- with :
55
- fail_ci_if_error : false
14
+ build :
15
+ if : " !contains(github.event.head_commit.message, 'skip ci')"
16
+
17
+ runs-on : ubuntu-latest
18
+
19
+ strategy :
20
+ fail-fast : false
21
+ matrix :
22
+ php :
23
+ - ' 7.3'
24
+ - ' 7.4'
25
+ - ' 8.0'
26
+ - ' 8.1'
27
+ laravel :
28
+ - 6.*
29
+ - 7.*
30
+ - 8.*
31
+ prefer :
32
+ - ' prefer-lowest'
33
+ - ' prefer-stable'
34
+ include :
35
+ - laravel : ' 6.*'
36
+ testbench : ' 4.*'
37
+ phpunit : ' ^8.5.8|^9.3.3'
38
+ - laravel : ' 7.*'
39
+ testbench : ' 5.*'
40
+ phpunit : ' ^8.5.8|^9.3.3'
41
+ - laravel : ' 8.*'
42
+ testbench : ' 6.*'
43
+ phpunit : ' ^9.3.3'
44
+ exclude :
45
+ - php : ' 8.0'
46
+ laravel : 6.*
47
+ prefer : ' prefer-lowest'
48
+ - php : ' 8.0'
49
+ laravel : 7.*
50
+ prefer : ' prefer-lowest'
51
+ - php : ' 8.1'
52
+ laravel : 6.*
53
+ - php : ' 8.1'
54
+ laravel : 7.*
55
+ - php : ' 8.1'
56
+ laravel : 8.*
57
+ prefer : ' prefer-lowest'
58
+
59
+ name : PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} --${{ matrix.prefer }}
60
+
61
+ steps :
62
+ - uses : actions/checkout@v1
63
+
64
+ - name : Setup PHP
65
+ uses : shivammathur/setup-php@v2
66
+ with :
67
+ php-version : ${{ matrix.php }}
68
+ extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
69
+ coverage : pcov
70
+
71
+ - name : Setup Redis
72
+ uses : supercharge/redis-github-action@1.1.0
73
+ with :
74
+ redis-version : 6
75
+
76
+ - uses : actions/cache@v1
77
+ name : Cache dependencies
78
+ with :
79
+ path : ~/.composer/cache/files
80
+ key : composer-php-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.prefer }}-${{ hashFiles('composer.json') }}
81
+
82
+ - name : Install dependencies
83
+ run : |
84
+ composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" "orchestra/database:${{ matrix.testbench }}" --no-interaction --no-update
85
+ composer update --${{ matrix.prefer }} --prefer-dist --no-interaction --no-suggest
86
+
87
+ - name : Run tests for Local
88
+ run : |
89
+ REPLICATION_MODE=local vendor/bin/phpunit --coverage-text --coverage-clover=coverage_local.xml
90
+
91
+ - name : Run tests for Redis
92
+ run : |
93
+ REPLICATION_MODE=redis vendor/bin/phpunit --coverage-text --coverage-clover=coverage_redis.xml
94
+
95
+ - uses : codecov/codecov-action@v1
96
+ with :
97
+ fail_ci_if_error : false
98
+ file : ' *.xml'
99
+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments