9
9
10
10
jobs :
11
11
unit :
12
- name : " Unit tests for PHP ${{ matrix.php-version }}"
12
+ name : " Unit and mutation tests for PHP ${{ matrix.php-version }} on ${{ matrix.os }}"
13
13
runs-on : ${{ matrix.os }}
14
14
continue-on-error : true
15
15
16
16
strategy :
17
17
matrix :
18
- os : ["ubuntu-latest"]
19
- php-version : ["7.4", "8.0", "8.1", "latest" ]
18
+ os : [ "ubuntu-latest", "windows-latest" ]
19
+ php-version : [ "7.4", "8.0", "8.1", "8.2" ]
20
20
21
21
env :
22
22
COMPOSER_VERSION : 2
@@ -25,14 +25,35 @@ jobs:
25
25
- name : Checkout repository
26
26
uses : actions/checkout@v3
27
27
28
- - name : Install dependencies
29
- uses : php-actions/composer@v6
28
+ - name : Setup PHP
29
+ uses : shivammathur/setup-php@v2
30
30
with :
31
- php_version : ${{ matrix.php-version }}
32
- version : ${{ env.COMPOSER_VERSION }}
31
+ php-version : ${{ matrix.php-version }}
32
+ coverage : ${{ env.COVERAGE_DRIVER }}
33
+ ini-values : memory_limit=512M, xdebug.mode=off
34
+ tools : composer:${{ env.COMPOSER_VERSION }}
33
35
34
- - name : Run unit tests
35
- uses : php-actions/phpunit@v3
36
+ - name : Get composer cache directory
37
+ id : composer-cache
38
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
39
+
40
+ - name : Cache dependencies
41
+ uses : actions/cache@v2
36
42
with :
37
- php_version : ${{ matrix.php-version }}
38
- args : --testsuite unit
43
+ path : ${{ steps.composer-cache.outputs.dir }}
44
+ key : composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
45
+ restore-keys : |
46
+ composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
47
+ composer-${{ runner.os }}-${{ matrix.php-version }}-
48
+ composer-${{ runner.os }}-
49
+ composer-
50
+
51
+ - name : Install dependencies
52
+ run : |
53
+ composer install --no-interaction --prefer-dist --no-progress
54
+
55
+ - name : Run unit tests
56
+ run : XDEBUG_MODE=coverage php vendor/bin/phpunit --testsuite unit
57
+
58
+ - name : Run mutation tests
59
+ run : XDEBUG_MODE=coverage php vendor/bin/infection --show-mutations
0 commit comments