Skip to content

Commit 9874b03

Browse files
Re-add mutation testing to pipeline
1 parent 2412cf3 commit 9874b03

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

.github/workflows/main.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ on:
99

1010
jobs:
1111
unit:
12-
name: "Unit tests for PHP ${{ matrix.php-version }}"
12+
name: "Unit and mutation tests for PHP ${{ matrix.php-version }} on ${{ matrix.os }}"
1313
runs-on: ${{ matrix.os }}
1414
continue-on-error: true
1515

1616
strategy:
1717
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" ]
2020

2121
env:
2222
COMPOSER_VERSION: 2
@@ -25,14 +25,35 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v3
2727

28-
- name: Install dependencies
29-
uses: php-actions/composer@v6
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
3030
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 }}
3335

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
3642
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

Comments
 (0)